feat : request tagging
This commit is contained in:
@@ -2,8 +2,12 @@ import 'package:rasadyar_core/core.dart';
|
||||
import 'package:rasadyar_livestock/data/common/dio_exception_handeler.dart';
|
||||
import 'package:rasadyar_livestock/data/data_source/remote/auth/auth_remote.dart';
|
||||
import 'package:rasadyar_livestock/data/data_source/remote/auth/auth_remote_imp.dart';
|
||||
import 'package:rasadyar_livestock/data/data_source/remote/livestock/livestock_remote.dart';
|
||||
import 'package:rasadyar_livestock/data/data_source/remote/livestock/livestock_remote_imp.dart';
|
||||
import 'package:rasadyar_livestock/data/repository/auth/auth_repository.dart';
|
||||
import 'package:rasadyar_livestock/data/repository/auth/auth_repository_imp.dart';
|
||||
import 'package:rasadyar_livestock/data/repository/livestock/livestock_repository.dart';
|
||||
import 'package:rasadyar_livestock/data/repository/livestock/livestock_repository_imp.dart';
|
||||
import 'package:rasadyar_livestock/presentation/routes/app_pages.dart';
|
||||
|
||||
GetIt get diLiveStock => GetIt.instance;
|
||||
@@ -17,7 +21,7 @@ Future<void> setupLiveStockDI() async {
|
||||
await tokenService.saveBaseUrl('https://api.dam.rasadyar.net/');
|
||||
}
|
||||
|
||||
// First register AppInterceptor with lazy callbacks
|
||||
// First register AppInterceptor with lazy callbacks
|
||||
diLiveStock.registerLazySingleton<AppInterceptor>(
|
||||
() => AppInterceptor(
|
||||
refreshTokenCallback: () async {
|
||||
@@ -55,13 +59,25 @@ Future<void> setupLiveStockDI() async {
|
||||
await diLiveStock.get<DioRemote>().init();
|
||||
|
||||
// Now register the data source and repository
|
||||
|
||||
//region Auth
|
||||
diLiveStock.registerLazySingleton<AuthRemoteDataSource>(
|
||||
() => AuthRemoteDataSourceImp(diLiveStock.get<DioRemote>()),
|
||||
);
|
||||
|
||||
diLiveStock.registerLazySingleton<AuthRepository>(
|
||||
() => AuthRepositoryImp(diLiveStock.get<AuthRemoteDataSource>()),
|
||||
() => AuthRepositoryImp(authRemote: diLiveStock.get<AuthRemoteDataSource>()),
|
||||
);
|
||||
//endregion
|
||||
|
||||
//region Livestock
|
||||
diLiveStock.registerLazySingleton<LivestockRemoteDataSource>(
|
||||
() => LivestockRemoteDataSourceImp(),
|
||||
);
|
||||
diLiveStock.registerLazySingleton<LivestockRepository>(
|
||||
() => LivestockRepositoryImp(livestockRemote: diLiveStock.get<LivestockRemoteDataSource>()),
|
||||
);
|
||||
//endregion
|
||||
|
||||
diLiveStock.registerLazySingleton<ImagePicker>(() => ImagePicker());
|
||||
await diLiveStock.allReady();
|
||||
|
||||
Reference in New Issue
Block a user