forked from eatvio/eatvio_app
190 lines
9.7 KiB
Dart
190 lines
9.7 KiB
Dart
import 'package:eatvio_app/core/error_reporting/api_response_error_reporter.dart';
|
|
import 'package:eatvio_app/core/comments/services/comments_service.dart';
|
|
import 'package:eatvio_app/core/firebase_api.dart';
|
|
import 'package:eatvio_app/core/views/service/views_service.dart';
|
|
import 'package:eatvio_app/core/websockets/ws_service.dart';
|
|
import 'package:eatvio_app/features/auth/services/auth_service.dart';
|
|
import 'package:eatvio_app/features/auth/services/reset_password_service.dart';
|
|
import 'package:eatvio_app/features/blog_post_create/services/blog_post_service.dart';
|
|
import 'package:eatvio_app/features/calendar/services/calendar_service.dart';
|
|
import 'package:eatvio_app/features/cancel_plan_bottom_sheet/service/cancel_plan_service.dart';
|
|
import 'package:eatvio_app/features/chat/services/chat_service.dart';
|
|
import 'package:eatvio_app/features/complaining/services/complaining_service.dart';
|
|
import 'package:eatvio_app/features/consultant/become_consultant/services/consultant_service.dart';
|
|
import 'package:eatvio_app/features/consultant_rating/services/consultant_rating_service.dart';
|
|
import 'package:eatvio_app/features/consultations/services/consultation_service.dart';
|
|
import 'package:eatvio_app/features/create_diet/services/create_diet_service.dart';
|
|
import 'package:eatvio_app/features/create_plan/services/create_plan_service.dart';
|
|
import 'package:eatvio_app/features/create_recipe/services/recipe_service.dart';
|
|
import 'package:eatvio_app/features/diary/services/diary_service.dart';
|
|
import 'package:eatvio_app/features/diets/services/diet_service.dart';
|
|
import 'package:eatvio_app/features/feed/services/feed_service.dart';
|
|
import 'package:eatvio_app/features/glossary/services/glossary_service.dart';
|
|
import 'package:eatvio_app/features/insights/services/insights_service.dart';
|
|
import 'package:eatvio_app/features/barcode/services/barcode_service.dart';
|
|
import 'package:eatvio_app/features/menu/services/blocked_users_service.dart';
|
|
import 'package:eatvio_app/features/menu/services/notification_settings_service.dart';
|
|
import 'package:eatvio_app/features/my_diets/services/my_diets_service.dart';
|
|
import 'package:eatvio_app/features/my_finance/services/cards_service.dart';
|
|
import 'package:eatvio_app/features/my_plans/services/my_plans_service.dart';
|
|
import 'package:eatvio_app/features/notifications/service/notifications_service.dart';
|
|
import 'package:eatvio_app/features/payment/services/sbp_service.dart';
|
|
import 'package:eatvio_app/features/personal_diet_suggestion/services/personal_diet_suggestion_service.dart';
|
|
import 'package:eatvio_app/features/plans/services/plan_service.dart';
|
|
import 'package:eatvio_app/features/plans/services/plans_service.dart';
|
|
import 'package:eatvio_app/features/profile/services/profile_service.dart';
|
|
import 'package:eatvio_app/features/recipe/services/about_recipe_service.dart';
|
|
import 'package:eatvio_app/features/recipe/services/my_recipes_service.dart';
|
|
import 'package:eatvio_app/features/registration/services/registration_service.dart';
|
|
import 'package:eatvio_app/features/registration_v2/services/registration_service_v2.dart';
|
|
import 'package:eatvio_app/features/settings/services/settings_service.dart';
|
|
import 'package:eatvio_app/features/video_calls/recordings/services/public_downloads_saver.dart';
|
|
import 'package:eatvio_app/features/video_calls/recordings/services/video_call_recording_file_service.dart';
|
|
import 'package:eatvio_app/features/video_calls/services/video_call_callkit_coordinator.dart';
|
|
import 'package:eatvio_app/features/video_calls/services/video_call_service.dart';
|
|
import 'package:eatvio_app/features/video_calls/services/video_call_system_pip_coordinator.dart';
|
|
import 'package:get_it/get_it.dart';
|
|
|
|
/// Регистрация всех Service в системе внедрения зависимостей
|
|
class ServiceRegistrations {
|
|
static final sl = GetIt.instance;
|
|
|
|
/// Регистрация всех Service
|
|
static void registerAll() {
|
|
_registerSingletonServices();
|
|
}
|
|
|
|
/// Регистрация Service как синглтонов
|
|
static void _registerSingletonServices() {
|
|
// Core services
|
|
sl.registerLazySingleton<ChatService>(
|
|
() => ChatService(sl(), errorLogger: sl<ApiResponseErrorReporter>()),
|
|
);
|
|
sl.registerLazySingleton<VideoCallService>(
|
|
() => VideoCallService(sl(), errorLogger: sl<ApiResponseErrorReporter>()),
|
|
);
|
|
sl.registerLazySingleton<PublicDownloadsSaver>(
|
|
() => const PublicDownloadsSaver(),
|
|
);
|
|
sl.registerLazySingleton<VideoCallRecordingFileService>(
|
|
() => VideoCallRecordingFileService(dio: sl(), downloadsSaver: sl()),
|
|
);
|
|
sl.registerLazySingleton<FeedService>(
|
|
() => FeedService(sl(), errorLogger: sl<ApiResponseErrorReporter>()),
|
|
);
|
|
sl.registerLazySingleton<ProfileService>(
|
|
() => ProfileService(sl(), errorLogger: sl<ApiResponseErrorReporter>()),
|
|
);
|
|
sl.registerLazySingleton<InsightsService>(
|
|
() => InsightsService(sl(), errorLogger: sl<ApiResponseErrorReporter>()),
|
|
);
|
|
sl.registerLazySingleton<CalendarService>(
|
|
() => CalendarService(sl(), errorLogger: sl<ApiResponseErrorReporter>()),
|
|
);
|
|
sl.registerLazySingleton<SettingsService>(
|
|
() => SettingsService(sl(), errorLogger: sl<ApiResponseErrorReporter>()),
|
|
);
|
|
sl.registerLazySingleton<ConsultantService>(
|
|
() => ConsultantService(sl(), errorLogger: sl<ApiResponseErrorReporter>()),
|
|
);
|
|
sl.registerLazySingleton<DiaryService>(
|
|
() => DiaryService(sl(), errorLogger: sl<ApiResponseErrorReporter>()),
|
|
);
|
|
sl.registerLazySingleton<GlossaryService>(
|
|
() => GlossaryService(sl(), errorLogger: sl<ApiResponseErrorReporter>()),
|
|
);
|
|
sl.registerLazySingleton<BarcodeService>(
|
|
() => BarcodeService(sl(), errorLogger: sl<ApiResponseErrorReporter>()),
|
|
);
|
|
sl.registerLazySingleton<DietService>(
|
|
() => DietService(sl(), errorLogger: sl<ApiResponseErrorReporter>()),
|
|
);
|
|
sl.registerLazySingleton<PlansService>(
|
|
() => PlansService(sl(), errorLogger: sl<ApiResponseErrorReporter>()),
|
|
);
|
|
sl.registerLazySingleton<PlanService>(
|
|
() => PlanService(sl(), errorLogger: sl<ApiResponseErrorReporter>()),
|
|
);
|
|
sl.registerLazySingleton<MyDietsService>(
|
|
() => MyDietsService(sl(), errorLogger: sl<ApiResponseErrorReporter>()),
|
|
);
|
|
sl.registerLazySingleton<MyPlansService>(
|
|
() => MyPlansService(sl(), errorLogger: sl<ApiResponseErrorReporter>()),
|
|
);
|
|
sl.registerLazySingleton<WsService>(() => WsService(sl(), errorLogger: sl<ApiResponseErrorReporter>()));
|
|
sl.registerLazySingleton<AboutRecipeService>(
|
|
() => AboutRecipeService(sl(), errorLogger: sl<ApiResponseErrorReporter>()),
|
|
);
|
|
sl.registerLazySingleton<ComplainingService>(
|
|
() => ComplainingService(sl(), errorLogger: sl<ApiResponseErrorReporter>()),
|
|
);
|
|
sl.registerLazySingleton<AuthService>(
|
|
() => AuthService(sl(), errorLogger: sl<ApiResponseErrorReporter>()),
|
|
);
|
|
sl.registerLazySingleton<CardsService>(
|
|
() => CardsService(sl(), errorLogger: sl<ApiResponseErrorReporter>()),
|
|
);
|
|
sl.registerLazySingleton<ConsultationService>(() => ConsultationService(sl()));
|
|
sl.registerLazySingleton<CancelPlanService>(
|
|
() => CancelPlanService(sl(), errorLogger: sl<ApiResponseErrorReporter>()),
|
|
);
|
|
sl.registerLazySingleton<CreatePlanService>(
|
|
() => CreatePlanService(sl(), errorLogger: sl<ApiResponseErrorReporter>()),
|
|
);
|
|
sl.registerLazySingleton<NotificationsService>(
|
|
() => NotificationsService(sl(), responseErrors: sl()),
|
|
);
|
|
sl.registerLazySingleton<FirebaseApi>(() => FirebaseApi(errorReporter: sl()));
|
|
sl.registerLazySingleton<VideoCallCallKitCoordinator>(
|
|
() => VideoCallCallKitCoordinator(firebaseApi: sl()),
|
|
);
|
|
sl.registerLazySingleton<VideoCallSystemPipCoordinator>(
|
|
() => VideoCallSystemPipCoordinator(),
|
|
);
|
|
sl.registerLazySingleton<ResetPasswordService>(
|
|
() => ResetPasswordService(sl(), errorLogger: sl<ApiResponseErrorReporter>()),
|
|
);
|
|
sl.registerLazySingleton<BlockedUserService>(
|
|
() => BlockedUserService(sl(), errorLogger: sl<ApiResponseErrorReporter>()),
|
|
);
|
|
sl.registerLazySingleton<CommentsService>(
|
|
() => CommentsService(sl(), errorLogger: sl<ApiResponseErrorReporter>()),
|
|
);
|
|
sl.registerLazySingleton<MyRecipesService>(
|
|
() => MyRecipesService(sl(), errorLogger: sl<ApiResponseErrorReporter>()),
|
|
);
|
|
sl.registerLazySingleton<ConsultantRatingService>(
|
|
() => ConsultantRatingService(sl(), errorLogger: sl<ApiResponseErrorReporter>()),
|
|
);
|
|
sl.registerLazySingleton<NotificationSettingsService>(
|
|
() => NotificationSettingsService(sl(), errorLogger: sl<ApiResponseErrorReporter>()),
|
|
);
|
|
sl.registerLazySingleton<ViewsService>(
|
|
() => ViewsService(sl(), errorLogger: sl<ApiResponseErrorReporter>()),
|
|
);
|
|
sl.registerLazySingleton<SbpService>(() => const SbpServiceImpl());
|
|
sl.registerLazySingleton<PersonalDietSuggestionService>(
|
|
() => PersonalDietSuggestionService(sl(), errorLogger: sl<ApiResponseErrorReporter>()),
|
|
);
|
|
sl.registerLazySingleton<RegistrationServiceV2>(
|
|
() => RegistrationServiceV2(sl(), errorLogger: sl<ApiResponseErrorReporter>()),
|
|
);
|
|
|
|
// Content services
|
|
sl.registerLazySingleton<CreateRecipeService>(
|
|
() => CreateRecipeService(sl(), errorLogger: sl<ApiResponseErrorReporter>()),
|
|
);
|
|
sl.registerLazySingleton<BlogPostService>(
|
|
() => BlogPostService(sl(), errorLogger: sl<ApiResponseErrorReporter>()),
|
|
);
|
|
sl.registerLazySingleton<CreateDietService>(
|
|
() => CreateDietService(sl(), errorLogger: sl<ApiResponseErrorReporter>()),
|
|
);
|
|
|
|
// Auth services
|
|
sl.registerLazySingleton<RegistrationService>(
|
|
() => RegistrationService(sl(), errorLogger: sl<ApiResponseErrorReporter>()),
|
|
);
|
|
}
|
|
}
|