refactor: Update badge
This commit is contained in:
parent
7dd8f7c1f5
commit
3b12d8ab84
3 changed files with 13 additions and 12 deletions
|
|
@ -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,
|
||||
);
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue