refactor: Update badge

This commit is contained in:
krille-chan 2023-08-19 08:17:40 +02:00
commit 3b12d8ab84
No known key found for this signature in database
3 changed files with 13 additions and 12 deletions

View file

@ -33,7 +33,14 @@ class UnreadRoomsBadge extends StatelessWidget {
.where((r) => (r.isUnread || r.membership == Membership.invite))
.length;
return b.Badge(
alignment: Alignment.bottomRight,
badgeStyle: b.BadgeStyle(
badgeColor: Theme.of(context).colorScheme.primary,
elevation: 4,
borderSide: BorderSide(
color: Theme.of(context).colorScheme.background,
width: 2,
),
),
badgeContent: Text(
unreadCount.toString(),
style: TextStyle(
@ -42,14 +49,8 @@ class UnreadRoomsBadge extends StatelessWidget {
),
),
showBadge: unreadCount != 0,
animationType: b.BadgeAnimationType.scale,
badgeColor: Theme.of(context).colorScheme.primary,
position: badgePosition,
elevation: 4,
borderSide: BorderSide(
color: Theme.of(context).colorScheme.background,
width: 2,
),
badgeAnimation: const b.BadgeAnimation.scale(),
position: badgePosition ?? b.BadgePosition.bottomEnd(),
child: child,
);
},