26 lines
879 B
Dart
26 lines
879 B
Dart
import 'package:rasadyar_auth/data/common/constant.dart';
|
|
import 'package:rasadyar_auth/data/repositories/auth_repository_imp.dart';
|
|
import 'package:rasadyar_auth/data/services/auth_service.dart';
|
|
import 'package:rasadyar_auth/data/services/token_storage_service.dart';
|
|
import 'package:rasadyar_core/core.dart';
|
|
|
|
import '../common/dio_manager.dart';
|
|
|
|
GetIt diAuth = GetIt.instance;
|
|
|
|
Future<void> setupAuthDI() async {
|
|
diAuth.registerLazySingleton(() => DioRemoteManager());
|
|
|
|
final manager = diAuth.get<DioRemoteManager>();
|
|
final dioRemote = manager.setEnvironment(ApiEnvironment.dam);
|
|
|
|
diAuth.registerLazySingleton<AuthRepositoryImpl>(
|
|
() => AuthRepositoryImpl(dioRemote),
|
|
);
|
|
diAuth.registerLazySingleton(() => AuthService());
|
|
diAuth.registerLazySingleton(() => TokenStorageService());
|
|
|
|
//hive
|
|
//await diAuth.registerCachedFactoryAsync(() async=>await ,)
|
|
}
|