import 'package:eatvio_app/core/app_initializer.dart'; import 'package:eatvio_app/core/cubit/marketing/marketing_cubit.dart'; import 'package:eatvio_app/core/env_config.dart'; import 'package:eatvio_app/core/internet_connection_cubit/internet_connection_cubit.dart'; import 'package:eatvio_app/core/locator_service.dart'; import 'package:eatvio_app/core/views/cubit/views_cubit.dart'; import 'package:eatvio_app/features/bottom_navigation_bar/presentation/bloc/new_messages_cubit/new_messages_cubit.dart'; import 'package:eatvio_app/features/notifications/presentation/notifications_cubit/notifications_cubit.dart'; import 'package:eatvio_app/features/bottom_navigation_bar/presentation/bloc/profile_avatar_cubit/profile_avatar_cubit.dart'; import 'package:eatvio_app/features/chat/presentation/bloc/chats_cubit/chats_cubit.dart'; import 'package:eatvio_app/features/video_calls/presentation/bloc/video_call_session/video_call_session_cubit.dart'; import 'package:eatvio_app/features/feed/presentation/bloc/feed_cubit/feed_cubit.dart'; import 'package:eatvio_app/generated/l10n.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_localizations/flutter_localizations.dart'; /// Конфигурация приложения class AppConfig { AppConfig({required this.buildType}) { _baseUrl = switch (buildType) { AppBuildType.prod => EnvConfig.baseUrl, AppBuildType.tests => EnvConfig.devBaseUrl, AppBuildType.dev => EnvConfig.devBaseUrl, }; } final AppBuildType buildType; late String _baseUrl; String get baseUrl => _baseUrl; void setBaseUrl(String baseUrls) { _baseUrl = baseUrls; } /// Список глобальных BlocProvider'ов /// Используются lazy: true для отложенной инициализации, чтобы не блокировать старт приложения List get globalBlocProviders => [ BlocProvider.value(value: sl()), BlocProvider(lazy: true, create: (context) => sl()), BlocProvider(lazy: true, create: (context) => sl()), BlocProvider(lazy: true, create: (context) => sl()), BlocProvider(lazy: true, create: (context) => sl()), BlocProvider(lazy: true, create: (context) => sl()), BlocProvider(lazy: true, create: (context) => sl()), BlocProvider(lazy: false, create: (context) => sl()), BlocProvider(lazy: true, create: (context) => sl()), ]; /// Делегаты локализации List get localizationDelegates => [ S.delegate, GlobalMaterialLocalizations.delegate, GlobalWidgetsLocalizations.delegate, GlobalCupertinoLocalizations.delegate, ]; /// Поддерживаемые локали List get supportedLocales => [const Locale.fromSubtags(languageCode: 'ru')]; }