web show notification when push notification is recieved

This commit is contained in:
amirrezaghabeli
2025-09-24 15:33:48 +03:30
parent 8a786b6ca4
commit 44b9e16a8d
6 changed files with 96 additions and 56 deletions
+6 -4
View File
@@ -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()),
+15
View File
@@ -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),
);
}
}