Added home-screen app-icon Notification badge

This commit is contained in:
2023-09-16 16:15:16 +02:00
parent c4dae8df8c
commit 248483be4e
9 changed files with 67 additions and 13 deletions

View File

@ -0,0 +1,22 @@
import 'package:firebase_messaging/firebase_messaging.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter_app_badger/flutter_app_badger.dart';
import 'package:provider/provider.dart';
import '../model/chatList/chatListProps.dart';
import '../model/chatList/chatProps.dart';
class NotificationTasks {
static void updateBadgeCount(RemoteMessage notification) {
FlutterAppBadger.updateBadgeCount(int.parse(notification.data['unreadCount'] ?? 0));
}
static void updateProviders(BuildContext context) {
Provider.of<ChatListProps>(context, listen: false).run(renew: true);
Provider.of<ChatProps>(context, listen: false).run();
}
static void navigateToTalk() {
// TODO Navigate
}
}