💄 Optimized chat room tile

This commit is contained in:
2025-05-17 03:22:04 +08:00
parent 401df0f49c
commit 641fcb4419
3 changed files with 107 additions and 41 deletions

View File

@ -36,13 +36,28 @@ class RealmListScreen extends HookConsumerWidget {
@override
Widget build(BuildContext context, WidgetRef ref) {
final realms = ref.watch(realmsJoinedProvider);
final realmInvites = ref.watch(realmInvitesProvider);
return AppScaffold(
appBar: AppBar(
title: const Text('realms').tr(),
actions: [
IconButton(
icon: const Icon(Symbols.email),
icon: Badge(
label: Text(
realmInvites.when(
data: (invites) => invites.length.toString(),
error: (_, __) => '0',
loading: () => '0',
),
),
isLabelVisible: realmInvites.when(
data: (invites) => invites.isNotEmpty,
error: (_, __) => false,
loading: () => false,
),
child: const Icon(Symbols.email),
),
onPressed: () {
showModalBottomSheet(
context: context,