mirror of
https://github.com/krille-chan/fluffychat
synced 2024-09-10 05:05:10 +00:00
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,
|
||||
);
|
||||
},
|
||||
|
|
|
@ -85,10 +85,10 @@ packages:
|
|||
dependency: "direct main"
|
||||
description:
|
||||
name: badges
|
||||
sha256: "727580d938b7a1ff47ea42df730d581415606b4224cfa708671c10287f8d3fe6"
|
||||
sha256: "6e7f3ec561ec08f47f912cfe349d4a1707afdc8dda271e17b046aa6d42c89e77"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.0.3"
|
||||
version: "3.1.1"
|
||||
base58check:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
|
|
@ -10,7 +10,7 @@ dependencies:
|
|||
adaptive_dialog: ^1.9.0-x-macos-beta.1
|
||||
animations: ^2.0.7
|
||||
archive: ^3.3.7
|
||||
badges: ^2.0.3
|
||||
badges: ^3.1.1
|
||||
blurhash_dart: ^1.1.0
|
||||
callkeep: ^0.3.2
|
||||
chewie: ^1.3.6
|
||||
|
|
Loading…
Reference in a new issue