registerLocationServiceGetItDi function
void
registerLocationServiceGetItDi()
Implementation
void registerLocationServiceGetItDi() {
/// Service
sl.registerLazySingleton<IAddressService>(() => AddressServiceImpl());
sl.registerLazySingleton<ICityNameService>(() => CityNameServiceImpl());
sl.registerLazySingleton<ICountryCodeService>(() => CountryCodeServiceImpl());
sl.registerLazySingleton<ILocationPermissionManager>(
() => LocationPermissionManagerGeolocatorProviderImpl(),
);
sl.registerLazySingleton<IGeoFirePointConverter>(
() => GeoFirePointConverterImpl(),
);
sl.registerLazySingleton<ILocationServiceGeoFirePointProvider>(
() => LocationServiceGeoFirePointProviderImpl(
iLocationServiceGeoLocatorProvider: sl(),
iGeoFirePointConverter: sl(),
),
);
sl.registerLazySingleton<ILocationServiceGeoLocatorProvider>(
() =>
LocationServiceGeoLocatorProviderImpl(iLocationPermissionManager: sl()),
);
sl.registerLazySingleton<INearbyLocationService>(
() => NearbyLocationService(),
);
/// ------ Repository -----
sl.registerLazySingleton<ICurrentLocationRepository>(
() =>
CurrentLocationRepositoryImpl(iLocationServiceGeoLocatorProvider: sl()),
);
sl.registerLazySingleton<ICityNameRepository>(
() => CityNameRepositoryImpl(
iCityNameService: sl(),
iLocationServiceGeoLocatorProvider: sl(),
),
);
sl.registerLazySingleton<ICountryCodeRepository>(
() => CountryCodeRepositoryImpl(
iLocationServiceGeoLocatorProvider: sl(),
iCountryCodeService: sl(),
),
);
/// ------ Use Cases -----
sl.registerLazySingleton<GetCityName>(() => GetCityName(sl()));
sl.registerLazySingleton<GetCountryCode>(() => GetCountryCode(sl()));
sl.registerLazySingleton<GetCurrentLocation>(() => GetCurrentLocation(sl()));
// View Models
sl.registerLazySingleton(() => LocationPickerCubit(getCurrentLocation: sl()));
sl.registerFactory(
() => CityNameCubit(getCityName: sl(), locationPickerCubit: sl()),
);
sl.registerFactory(() => CountryCodeCubit(getCountryCode: sl()));
}