diff --git a/lib/core/di/cubit_registrations.dart b/lib/core/di/cubit_registrations.dart index 156e43b1..babff4f6 100644 --- a/lib/core/di/cubit_registrations.dart +++ b/lib/core/di/cubit_registrations.dart @@ -23,6 +23,7 @@ import 'package:eatvio_app/features/feed/presentation/bloc/consultants_cubit/con import 'package:eatvio_app/features/feed/presentation/bloc/diets_cubit/diets_cubit.dart'; import 'package:eatvio_app/features/feed/presentation/bloc/feed_cubit/feed_cubit.dart'; import 'package:eatvio_app/features/feed/presentation/bloc/plans_cubit/plans_cubit.dart'; +import 'package:eatvio_app/features/feed/presentation/bloc/profile_cubit/profile_cubit.dart'; import 'package:eatvio_app/features/feed/presentation/bloc/recipes_cubit/recipes_cubit.dart'; import 'package:eatvio_app/features/finances_and_consultations_archive/cubit/archive/consultations_archive_cubit.dart'; import 'package:eatvio_app/features/finances_and_consultations_archive/cubit/consultant_finances/consultant_finances_cubit.dart'; @@ -60,15 +61,9 @@ class CubitRegistrations { /// Регистрация Cubit'ов как синглтонов static void _registerSingletonCubits() { sl.registerLazySingleton(() => NewMessagesCubit()); - sl.registerLazySingleton( - () => NotificationsCubit(wsManager: sl(), notificationsRepository: sl()), - ); - sl.registerLazySingleton( - () => ProfileAvatarCubit(profileRepository: sl()), - ); - sl.registerLazySingleton( - () => ChatsCubit(chatRepository: sl(), wsManager: sl(), profileRepository: sl()), - ); + sl.registerLazySingleton(() => NotificationsCubit(wsManager: sl(), notificationsRepository: sl())); + sl.registerLazySingleton(() => ProfileAvatarCubit(profileRepository: sl())); + sl.registerLazySingleton(() => ChatsCubit(chatRepository: sl(), wsManager: sl(), profileRepository: sl())); } /// Регистрация Cubit'ов как фабрик @@ -81,34 +76,25 @@ class CubitRegistrations { // Feed related cubits sl.registerFactory(() => FeedCubit(feedRepository: sl())); - sl.registerFactory( - () => RecipesCubit(feedRepository: sl(), recipeRepository: sl(), aboutRecipeRepository: sl()), - ); + sl.registerFactory(() => RecipesCubit(feedRepository: sl(), recipeRepository: sl(), aboutRecipeRepository: sl())); sl.registerFactory(() => DietsCubit(feedRepository: sl(), dietsRepository: sl())); sl.registerFactory(() => PlansCubit(feedRepository: sl(), planRepository: sl())); sl.registerFactory(() => ConsultantsCubit(feedRepository: sl())); sl.registerFactory(() => CommentsCubit(feedRepository: sl(), commentsRepository: sl())); + sl.registerFactory(() => FeedProfileCubit(profileRepository: sl())); // Chat related cubits - sl.registerFactory( - () => ChatRoomCubit(cardsRepository: sl(), chatRepository: sl(), wsManager: sl()), - ); + sl.registerFactory(() => ChatRoomCubit(cardsRepository: sl(), chatRepository: sl(), wsManager: sl())); // Profile related cubits - sl.registerFactory( - () => ProfileCubit(profileRepository: sl(), chatRepository: sl(), consultantRepository: sl()), - ); + sl.registerFactory(() => ProfileCubit(profileRepository: sl(), chatRepository: sl(), consultantRepository: sl())); sl.registerFactory(() => profile_plans.PlansCubit(plansRepository: sl())); sl.registerFactory(() => SubCubit(profileRepository: sl())); // Content creation cubits - sl.registerFactory( - () => CreateDietCubit(profileRepository: sl(), createDietRepository: sl(), glossaryRepository: sl()), - ); + sl.registerFactory(() => CreateDietCubit(profileRepository: sl(), createDietRepository: sl(), glossaryRepository: sl())); sl.registerFactory(() => CreatePlanCubit(createPlanRepository: sl())); - sl.registerFactory( - () => CreateRecipeCubit(recipeRepository: sl(), glossaryRepository: sl()), - ); + sl.registerFactory(() => CreateRecipeCubit(recipeRepository: sl(), glossaryRepository: sl())); sl.registerFactory(() => BlogPostCreateCubit(blogPostRepository: sl())); // Content viewing cubits @@ -135,12 +121,7 @@ class CubitRegistrations { ), ); sl.registerFactory( - () => SettingsCubit( - profileRepository: sl(), - settingsRepository: sl(), - consultantRepository: sl(), - consultationsRepository: sl(), - ), + () => SettingsCubit(profileRepository: sl(), settingsRepository: sl(), consultantRepository: sl(), consultationsRepository: sl()), ); sl.registerFactory(() => RegisterConsultantCubit(consultantRepository: sl())); sl.registerFactory(() => ComplainingCubit(repository: sl()));