Notification UI

This commit is contained in:
2025-05-20 01:14:13 +08:00
parent 9d6cf54bf8
commit 9e609b8fe4
13 changed files with 741 additions and 238 deletions

View File

@ -9,6 +9,7 @@ import 'package:island/pods/message.dart';
import 'package:island/pods/network.dart';
import 'package:island/pods/userinfo.dart';
import 'package:island/route.gr.dart';
import 'package:island/screens/notification.dart';
import 'package:island/services/responsive.dart';
import 'package:island/widgets/account/status.dart';
import 'package:island/widgets/account/leveling_progress.dart';
@ -52,6 +53,9 @@ class AccountScreen extends HookConsumerWidget {
}
final user = ref.watch(userInfoProvider);
final notificationUnreadCount = ref.watch(
notificationUnreadCountNotifierProvider,
);
if (!user.hasValue || user.value == null) {
return _UnauthorizedAccountScreen();
@ -168,12 +172,20 @@ class AccountScreen extends HookConsumerWidget {
const Gap(8),
ListTile(
minTileHeight: 48,
leading: const Icon(Symbols.public),
leading: const Icon(Symbols.notifications),
trailing: const Icon(Symbols.chevron_right),
contentPadding: EdgeInsets.symmetric(horizontal: 24),
title: Text('publishers').tr(),
title: Row(
children: [
Expanded(child: Text('notifications').tr()),
Badge.count(
count: notificationUnreadCount.value ?? 0,
isLabelVisible: (notificationUnreadCount.value ?? 0) > 0,
),
],
),
onTap: () {
context.router.push(ManagedPublisherRoute());
context.router.push(NotificationRoute());
},
),
ListTile(