Changed Badge position for talk integration
This commit is contained in:
parent
ce60787ec2
commit
8159ab0963
11
lib/app.dart
11
lib/app.dart
@ -24,9 +24,7 @@ class _AppState extends State<App> {
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
Timer.periodic(const Duration(seconds: 30), (Timer t) => {
|
||||
setState((){}),
|
||||
});
|
||||
Timer.periodic(const Duration(seconds: 30), (Timer t) => setState((){}));
|
||||
|
||||
WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
|
||||
Provider.of<ChatListProps>(context, listen: false).run();
|
||||
@ -72,11 +70,14 @@ class _AppState extends State<App> {
|
||||
int messages = value.getRoomsResponse.data.map((e) => e.unreadMessages).reduce((a, b) => a+b);
|
||||
return badges.Badge(
|
||||
showBadge: messages > 0,
|
||||
position: badges.BadgePosition.bottomEnd(),
|
||||
position: badges.BadgePosition.topEnd(top: -3, end: -3),
|
||||
stackFit: StackFit.loose,
|
||||
badgeStyle: badges.BadgeStyle(
|
||||
padding: EdgeInsets.all(3),
|
||||
badgeColor: Theme.of(context).primaryColor,
|
||||
elevation: 1,
|
||||
),
|
||||
badgeContent: Text("$messages", style: const TextStyle(color: Colors.white)),
|
||||
badgeContent: Text("$messages", style: const TextStyle(color: Colors.white, fontSize: 10, fontWeight: FontWeight.bold)),
|
||||
child: const Icon(Icons.chat),
|
||||
);
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user