24 lines
754 B
Dart
24 lines
754 B
Dart
import 'package:firebase_messaging/firebase_messaging.dart';
|
|
import 'package:flutter/cupertino.dart';
|
|
import 'package:flutter_app_badge/flutter_app_badge.dart';
|
|
import 'package:provider/provider.dart';
|
|
|
|
import '../main.dart';
|
|
import '../model/chatList/chatListProps.dart';
|
|
import '../model/chatList/chatProps.dart';
|
|
|
|
class NotificationTasks {
|
|
static void updateBadgeCount(RemoteMessage notification) {
|
|
FlutterAppBadge.count(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() {
|
|
Main.bottomNavigator.jumpToTab(1);
|
|
}
|
|
}
|