web show notification when push notification is recieved
This commit is contained in:
@@ -60,7 +60,7 @@ List<SingleChildWidget> get apiClients {
|
||||
Provider(
|
||||
create: (context) => ProfileService(networkManager: context.read()),
|
||||
),
|
||||
Provider(
|
||||
Provider(
|
||||
create: (context) => NotificationsService(networkManager: context.read()),
|
||||
),
|
||||
];
|
||||
@@ -100,8 +100,10 @@ List<SingleChildWidget> get repositories {
|
||||
Provider(
|
||||
create: (context) => ProfileRepository(profileService: context.read()),
|
||||
),
|
||||
Provider(
|
||||
create: (context) => NotificationsRepository(notificationsService: context.read()),
|
||||
Provider(
|
||||
create:
|
||||
(context) =>
|
||||
NotificationsRepository(notificationsService: context.read()),
|
||||
),
|
||||
];
|
||||
}
|
||||
@@ -155,7 +157,7 @@ List<SingleChildWidget> get viewModels {
|
||||
ChangeNotifierProvider(
|
||||
create: (context) => FinalCompletionOfDocumentsViewModel(),
|
||||
),
|
||||
ChangeNotifierProvider(
|
||||
ChangeNotifierProvider(
|
||||
create:
|
||||
(context) =>
|
||||
NotificationViewModel(repositoryViewModel: context.read()),
|
||||
|
||||
@@ -21,4 +21,19 @@ class AppToast {
|
||||
autoCloseDuration: const Duration(seconds: 3),
|
||||
);
|
||||
}
|
||||
|
||||
static void notification(
|
||||
BuildContext context,
|
||||
String title,
|
||||
String description,
|
||||
) {
|
||||
toastification.show(
|
||||
context: context,
|
||||
type: ToastificationType.info,
|
||||
style: ToastificationStyle.flatColored,
|
||||
title: Text(title),
|
||||
description: Text(description),
|
||||
autoCloseDuration: const Duration(seconds: 6),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user