💄 Update account screen
This commit is contained in:
@@ -376,7 +376,7 @@ class AccountScreen extends HookConsumerWidget {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'icon': Symbols.group,
|
'icon': Symbols.groups_3,
|
||||||
'title': 'realms',
|
'title': 'realms',
|
||||||
'onTap': () {
|
'onTap': () {
|
||||||
context.goNamed('realmList');
|
context.goNamed('realmList');
|
||||||
@@ -418,67 +418,47 @@ class AccountScreen extends HookConsumerWidget {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
return GridView.builder(
|
return Column(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 12),
|
children: menuItems.map((item) {
|
||||||
shrinkWrap: true,
|
|
||||||
physics: NeverScrollableScrollPhysics(),
|
|
||||||
gridDelegate: SliverGridDelegateWithMaxCrossAxisExtent(
|
|
||||||
maxCrossAxisExtent: 80,
|
|
||||||
crossAxisSpacing: 8,
|
|
||||||
mainAxisSpacing: 8,
|
|
||||||
),
|
|
||||||
itemCount: menuItems.length,
|
|
||||||
itemBuilder: (context, index) {
|
|
||||||
final item = menuItems[index];
|
|
||||||
final icon = item['icon'] as IconData;
|
final icon = item['icon'] as IconData;
|
||||||
final title = item['title'] as String;
|
final title = item['title'] as String;
|
||||||
final badgeCount = item['badgeCount'] as int?;
|
final badgeCount = item['badgeCount'] as int?;
|
||||||
final onTap = item['onTap'] as VoidCallback?;
|
final onTap = item['onTap'] as VoidCallback?;
|
||||||
return Card(
|
return ListTile(
|
||||||
margin: EdgeInsets.zero,
|
contentPadding: const EdgeInsets.symmetric(
|
||||||
child: Tooltip(
|
horizontal: 24,
|
||||||
message: title.tr(),
|
|
||||||
child: InkWell(
|
|
||||||
borderRadius: BorderRadius.circular(8),
|
|
||||||
onTap: onTap,
|
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsets.all(16),
|
|
||||||
child: Column(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
children: [
|
|
||||||
Badge(
|
|
||||||
isLabelVisible:
|
|
||||||
badgeCount != null && badgeCount > 0,
|
|
||||||
label: Text(badgeCount.toString()),
|
|
||||||
child: Icon(icon, size: 28),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
|
trailing: const Icon(Symbols.chevron_right),
|
||||||
|
dense: true,
|
||||||
|
leading: Badge(
|
||||||
|
isLabelVisible: badgeCount != null && badgeCount > 0,
|
||||||
|
label: Text(badgeCount.toString()),
|
||||||
|
child: Icon(icon, size: 24),
|
||||||
|
),
|
||||||
|
title: Text(title).tr(),
|
||||||
|
onTap: onTap,
|
||||||
);
|
);
|
||||||
},
|
}).toList(),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
const Divider(height: 1).padding(vertical: 8),
|
const Divider(height: 1).padding(vertical: 8),
|
||||||
ListTile(
|
ListTile(
|
||||||
minTileHeight: 48,
|
|
||||||
leading: const Icon(Symbols.info),
|
leading: const Icon(Symbols.info),
|
||||||
trailing: const Icon(Symbols.chevron_right),
|
trailing: const Icon(Symbols.chevron_right),
|
||||||
contentPadding: EdgeInsets.symmetric(horizontal: 24),
|
contentPadding: EdgeInsets.symmetric(horizontal: 24),
|
||||||
|
dense: true,
|
||||||
title: Text('about').tr(),
|
title: Text('about').tr(),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
context.pushNamed('about');
|
context.pushNamed('about');
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
ListTile(
|
ListTile(
|
||||||
minTileHeight: 48,
|
|
||||||
leading: const Icon(Symbols.bug_report),
|
leading: const Icon(Symbols.bug_report),
|
||||||
trailing: const Icon(Symbols.chevron_right),
|
trailing: const Icon(Symbols.chevron_right),
|
||||||
contentPadding: EdgeInsets.symmetric(horizontal: 24),
|
contentPadding: EdgeInsets.symmetric(horizontal: 24),
|
||||||
title: Text('debugOptions').tr(),
|
title: Text('debugOptions').tr(),
|
||||||
|
dense: true,
|
||||||
onTap: () {
|
onTap: () {
|
||||||
showModalBottomSheet(
|
showModalBottomSheet(
|
||||||
useRootNavigator: true,
|
useRootNavigator: true,
|
||||||
@@ -489,11 +469,11 @@ class AccountScreen extends HookConsumerWidget {
|
|||||||
},
|
},
|
||||||
),
|
),
|
||||||
ListTile(
|
ListTile(
|
||||||
minTileHeight: 48,
|
|
||||||
leading: const Icon(Symbols.logout),
|
leading: const Icon(Symbols.logout),
|
||||||
trailing: const Icon(Symbols.chevron_right),
|
trailing: const Icon(Symbols.chevron_right),
|
||||||
contentPadding: EdgeInsets.symmetric(horizontal: 24),
|
contentPadding: EdgeInsets.symmetric(horizontal: 24),
|
||||||
title: Text('logout').tr(),
|
title: Text('logout').tr(),
|
||||||
|
dense: true,
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
final ws = ref.watch(websocketStateProvider.notifier);
|
final ws = ref.watch(websocketStateProvider.notifier);
|
||||||
final apiClient = ref.watch(apiClientProvider);
|
final apiClient = ref.watch(apiClientProvider);
|
||||||
|
|||||||
Reference in New Issue
Block a user