✨ Dashboard unread count
This commit is contained in:
@@ -446,9 +446,12 @@ class AccountScreen extends HookConsumerWidget {
|
|||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
Icon(icon, size: 28),
|
Badge(
|
||||||
if (badgeCount != null && badgeCount > 0)
|
isLabelVisible:
|
||||||
Badge.count(count: badgeCount),
|
badgeCount != null && badgeCount > 0,
|
||||||
|
label: Text(badgeCount.toString()),
|
||||||
|
child: Icon(icon, size: 28),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import 'package:go_router/go_router.dart';
|
|||||||
import 'package:google_fonts/google_fonts.dart';
|
import 'package:google_fonts/google_fonts.dart';
|
||||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||||
import 'package:island/pods/chat/chat_room.dart';
|
import 'package:island/pods/chat/chat_room.dart';
|
||||||
|
import 'package:island/pods/chat/chat_summary.dart';
|
||||||
import 'package:island/pods/event_calendar.dart';
|
import 'package:island/pods/event_calendar.dart';
|
||||||
import 'package:island/pods/userinfo.dart';
|
import 'package:island/pods/userinfo.dart';
|
||||||
import 'package:island/screens/chat/chat.dart';
|
import 'package:island/screens/chat/chat.dart';
|
||||||
@@ -337,6 +338,7 @@ class NotificationsCard extends HookConsumerWidget {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context, WidgetRef ref) {
|
Widget build(BuildContext context, WidgetRef ref) {
|
||||||
final notifications = ref.watch(notificationListProvider);
|
final notifications = ref.watch(notificationListProvider);
|
||||||
|
final notificationsUnreadCount = ref.watch(notificationUnreadCountProvider);
|
||||||
|
|
||||||
return Card(
|
return Card(
|
||||||
margin: EdgeInsets.zero,
|
margin: EdgeInsets.zero,
|
||||||
@@ -373,6 +375,10 @@ class NotificationsCard extends HookConsumerWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
Badge.count(
|
||||||
|
count: notificationsUnreadCount.value ?? 0,
|
||||||
|
isLabelVisible: (notificationsUnreadCount.value ?? 0) > 0,
|
||||||
|
),
|
||||||
],
|
],
|
||||||
).padding(horizontal: 16, vertical: 12),
|
).padding(horizontal: 16, vertical: 12),
|
||||||
notifications.when(
|
notifications.when(
|
||||||
@@ -424,6 +430,7 @@ class ChatListCard extends HookConsumerWidget {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context, WidgetRef ref) {
|
Widget build(BuildContext context, WidgetRef ref) {
|
||||||
final chatRooms = ref.watch(chatRoomJoinedProvider);
|
final chatRooms = ref.watch(chatRoomJoinedProvider);
|
||||||
|
final chatUnreadCount = ref.watch(chatUnreadCountProvider);
|
||||||
|
|
||||||
return Card(
|
return Card(
|
||||||
margin: EdgeInsets.zero,
|
margin: EdgeInsets.zero,
|
||||||
@@ -449,6 +456,10 @@ class ChatListCard extends HookConsumerWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
Badge.count(
|
||||||
|
count: chatUnreadCount.value ?? 0,
|
||||||
|
isLabelVisible: (chatUnreadCount.value ?? 0) > 0,
|
||||||
|
),
|
||||||
],
|
],
|
||||||
).padding(horizontal: 16, vertical: 16),
|
).padding(horizontal: 16, vertical: 16),
|
||||||
chatRooms.when(
|
chatRooms.when(
|
||||||
|
|||||||
Reference in New Issue
Block a user