updated app badger
This commit is contained in:
parent
4d3a33dd9b
commit
e9739ac2d5
@ -1,4 +1,5 @@
|
|||||||
import 'package:flutter_app_badger/flutter_app_badger.dart';
|
|
||||||
|
import 'package:flutter_app_badge/flutter_app_badge.dart';
|
||||||
|
|
||||||
import '../../api/apiResponse.dart';
|
import '../../api/apiResponse.dart';
|
||||||
import '../../api/marianumcloud/talk/room/getRoomCache.dart';
|
import '../../api/marianumcloud/talk/room/getRoomCache.dart';
|
||||||
@ -19,7 +20,7 @@ class ChatListProps extends DataHolder {
|
|||||||
onUpdate: (GetRoomResponse data) => {
|
onUpdate: (GetRoomResponse data) => {
|
||||||
_getRoomResponse = data,
|
_getRoomResponse = data,
|
||||||
notifyListeners(),
|
notifyListeners(),
|
||||||
FlutterAppBadger.updateBadgeCount(data.data.map((e) => e.unreadMessages).reduce((a, b) => a+b))
|
FlutterAppBadge.count(data.data.map((e) => e.unreadMessages).reduce((a, b) => a+b))
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import 'package:firebase_messaging/firebase_messaging.dart';
|
import 'package:firebase_messaging/firebase_messaging.dart';
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter_app_badger/flutter_app_badger.dart';
|
import 'package:flutter_app_badge/flutter_app_badge.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
import '../main.dart';
|
import '../main.dart';
|
||||||
@ -9,7 +9,7 @@ import '../model/chatList/chatProps.dart';
|
|||||||
|
|
||||||
class NotificationTasks {
|
class NotificationTasks {
|
||||||
static void updateBadgeCount(RemoteMessage notification) {
|
static void updateBadgeCount(RemoteMessage notification) {
|
||||||
FlutterAppBadger.updateBadgeCount(int.parse(notification.data['unreadCount'] ?? 0));
|
FlutterAppBadge.count(int.parse(notification.data['unreadCount'] ?? 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void updateProviders(BuildContext context) {
|
static void updateProviders(BuildContext context) {
|
||||||
|
@ -87,7 +87,7 @@ dependencies:
|
|||||||
flutter_split_view: any
|
flutter_split_view: any
|
||||||
bottom_sheet: any
|
bottom_sheet: any
|
||||||
device_info_plus: any
|
device_info_plus: any
|
||||||
flutter_app_badger: any
|
flutter_app_badge: any
|
||||||
qr_flutter: any
|
qr_flutter: any
|
||||||
easy_debounce: any
|
easy_debounce: any
|
||||||
rrule_generator: any
|
rrule_generator: any
|
||||||
|
Loading…
x
Reference in New Issue
Block a user