Update .gitignore to exclude Firebase configuration files and refactor notification handling in the app. Removed redundant logging and notification data storage in SharedPreferences. Introduced NotificationCheckService and NotificationStateService for improved notification management. Updated view models and UI components to utilize the new services, enhancing notification state tracking and user experience.

This commit is contained in:
amirrezaghabeli
2025-10-06 11:59:54 +03:30
parent 17634744f7
commit 42f2e93a8e
28 changed files with 1499 additions and 595 deletions
+25 -15
View File
@@ -10,7 +10,9 @@ import 'package:tm_app/data/repositories/tenders_repository.dart';
import 'package:tm_app/data/repositories/your_tenders_repository.dart';
import 'package:tm_app/data/services/home_service.dart';
import 'package:tm_app/data/services/liked_tenders_service.dart';
import 'package:tm_app/data/services/notification_check_service.dart';
import 'package:tm_app/data/services/notification_service.dart';
import 'package:tm_app/data/services/notification_state_service.dart';
import 'package:tm_app/data/services/tender_detail_service.dart';
import 'package:tm_app/data/services/your_tenders_service.dart';
import 'package:tm_app/view_models/final_completion_of_documents_view_model.dart';
@@ -30,13 +32,14 @@ import '../../view_models/home_view_model.dart';
import '../../view_models/profile_view_model.dart';
List<SingleChildWidget> get providersRemote {
return [...cores, ...apiClients, ...repositories, ...viewModels, ...others];
return [...cores, ...apiClients, ...repositories, ...services, ...viewModels];
}
List<SingleChildWidget> get cores {
return [
Provider(create: (context) => NetworkManager(context.read())),
ChangeNotifierProvider(create: (context) => ThemeProvider()),
ChangeNotifierProvider(create: (context) => NotificationStateService()),
];
}
@@ -108,20 +111,32 @@ List<SingleChildWidget> get repositories {
];
}
List<SingleChildWidget> get services {
return [
Provider(
create:
(context) => NotificationCheckService(
homeRepository: context.read(),
notificationStateService: context.read(),
),
),
];
}
List<SingleChildWidget> get viewModels {
return [
ChangeNotifierProvider(
create: (context) => AuthViewModel(authRepository: context.read()),
),
ChangeNotifierProvider(
create: (context) => HomeViewModel(homeRepository: context.read()),
create:
(context) => HomeViewModel(
homeRepository: context.read(),
notificationStateService: context.read(),
),
),
ChangeNotifierProvider(
create:
(context) => TendersViewModel(
tendersRepository: context.read(),
homeViewModel: context.read(),
),
create: (context) => TendersViewModel(tendersRepository: context.read()),
),
ChangeNotifierProvider(
create:
@@ -129,7 +144,6 @@ List<SingleChildWidget> get viewModels {
tenderDetailRepository: context.read(),
tendersRepository: context.read(),
tendersViewModel: context.read(),
homeViewModel: context.read(),
),
),
@@ -143,7 +157,6 @@ List<SingleChildWidget> get viewModels {
(context) => LikedTendersViewModel(
likedTendersRepository: context.read(),
tendersRepository: context.read(),
homeViewModel: context.read(),
),
),
ChangeNotifierProvider(
@@ -160,13 +173,10 @@ List<SingleChildWidget> get viewModels {
ChangeNotifierProvider(
create:
(context) => NotificationViewModel(
repositoryViewModel: context.read(),
homeViewModel: context.read(),
notificationsRepository: context.read(),
notificationStateService: context.read(),
notificationCheckService: context.read(),
),
),
];
}
List<SingleChildWidget> get others {
return [];
}