refactor: update global states to ValueNotifiers

This commit is contained in:
shenlong-tanwen
2024-10-18 09:19:39 +05:30
parent c91a2878dc
commit e8bb9a3934
7 changed files with 21 additions and 22 deletions
+4 -4
View File
@@ -120,7 +120,7 @@ class ServiceLocator {
static void _registerPreGlobalStates() {
_registerSingleton(AppRouter());
_registerLazySingleton<AppThemeCubit>(() => AppThemeCubit(di()));
_registerSingleton(GalleryPermissionNotifier());
_registerSingleton(GalleryPermissionProvider());
}
static void registerApiClient(String endpoint) {
@@ -138,12 +138,12 @@ class ServiceLocator {
}
static void registerPostGlobalStates() {
_registerLazySingleton<ServerFeatureConfigCubit>(
() => ServerFeatureConfigCubit(di()),
_registerLazySingleton<ServerFeatureConfigProvider>(
() => ServerFeatureConfigProvider(di()),
);
}
static void registerCurrentUser(User user) {
_registerSingleton(CurrentUserCubit(user));
_registerSingleton(CurrentUserProvider(user));
}
}