Convert all inline function to methods
This commit is contained in:
parent
7a140fca6f
commit
d333f15fad
|
@ -174,6 +174,26 @@ class _AboutTab extends HookWidget {
|
||||||
const _AboutTab(this.site, {@required this.communitiesFuture})
|
const _AboutTab(this.site, {@required this.communitiesFuture})
|
||||||
: assert(communitiesFuture != null);
|
: assert(communitiesFuture != null);
|
||||||
|
|
||||||
|
void goToUser(int id) {
|
||||||
|
print('GO TO USER $id');
|
||||||
|
}
|
||||||
|
|
||||||
|
void goToModLog() {
|
||||||
|
print('GO TO MODLOG');
|
||||||
|
}
|
||||||
|
|
||||||
|
void goToBannedUsers() {
|
||||||
|
print('GO TO BANNED USERS');
|
||||||
|
}
|
||||||
|
|
||||||
|
void goToCommunity(int id) {
|
||||||
|
print('GO TO COMMUNITY $id');
|
||||||
|
}
|
||||||
|
|
||||||
|
void goToCommunities() {
|
||||||
|
print('GO TO COMMUNITIES');
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final theme = Theme.of(context);
|
final theme = Theme.of(context);
|
||||||
|
@ -212,7 +232,7 @@ class _AboutTab extends HookWidget {
|
||||||
),
|
),
|
||||||
if (commSnap.hasData)
|
if (commSnap.hasData)
|
||||||
...commSnap.data.getRange(0, 6).map((e) => ListTile(
|
...commSnap.data.getRange(0, 6).map((e) => ListTile(
|
||||||
onTap: () => print('GO TO COMMUNITY ${e.name}'),
|
onTap: () => goToCommunity(e.id),
|
||||||
title: Text(e.name),
|
title: Text(e.name),
|
||||||
leading: e.icon != null
|
leading: e.icon != null
|
||||||
? CachedNetworkImage(
|
? CachedNetworkImage(
|
||||||
|
@ -242,7 +262,7 @@ class _AboutTab extends HookWidget {
|
||||||
),
|
),
|
||||||
ListTile(
|
ListTile(
|
||||||
title: Center(child: Text('See all')),
|
title: Center(child: Text('See all')),
|
||||||
onTap: () => print('GO TO COMMUNITIES'),
|
onTap: goToCommunities,
|
||||||
),
|
),
|
||||||
_Divider(),
|
_Divider(),
|
||||||
ListTile(
|
ListTile(
|
||||||
|
@ -256,7 +276,7 @@ class _AboutTab extends HookWidget {
|
||||||
...site.admins.map((e) => ListTile(
|
...site.admins.map((e) => ListTile(
|
||||||
title: Text(e.preferredUsername ?? '@${e.name}'),
|
title: Text(e.preferredUsername ?? '@${e.name}'),
|
||||||
subtitle: e.bio != null ? Text('${e.bio}') : null,
|
subtitle: e.bio != null ? Text('${e.bio}') : null,
|
||||||
onTap: () => print('GO TO USER ${e.name}'),
|
onTap: () => goToUser(e.id),
|
||||||
leading: e.avatar != null
|
leading: e.avatar != null
|
||||||
? CachedNetworkImage(
|
? CachedNetworkImage(
|
||||||
height: 50,
|
height: 50,
|
||||||
|
@ -286,17 +306,17 @@ class _AboutTab extends HookWidget {
|
||||||
(e.preferredUsername == null || e.preferredUsername == '')
|
(e.preferredUsername == null || e.preferredUsername == '')
|
||||||
? '@${e.name}'
|
? '@${e.name}'
|
||||||
: e.preferredUsername),
|
: e.preferredUsername),
|
||||||
onTap: () => print('GO TO USER ${e.name}'),
|
onTap: () => goToUser(e.id),
|
||||||
leading: SizedBox(width: 50),
|
leading: SizedBox(width: 50),
|
||||||
)),
|
)),
|
||||||
ListTile(
|
ListTile(
|
||||||
title: Center(child: Text('See all')),
|
title: Center(child: Text('See all')),
|
||||||
onTap: () => print('GO TO BANNED USERS PAGE'),
|
onTap: goToBannedUsers,
|
||||||
),
|
),
|
||||||
_Divider(),
|
_Divider(),
|
||||||
ListTile(
|
ListTile(
|
||||||
title: Center(child: Text('Modlog')),
|
title: Center(child: Text('Modlog')),
|
||||||
onTap: () => print('GO TO MODLOG'),
|
onTap: goToModLog,
|
||||||
),
|
),
|
||||||
SizedBox(height: 20),
|
SizedBox(height: 20),
|
||||||
],
|
],
|
||||||
|
|
Loading…
Reference in New Issue