- Config Spec-Kit pour Spec-Driven Development - CONSTITUTION.md + .specify/memory/constitution.md - Commandes Cursor /speckit.*, règles projet - Mission: associations + mutuelles d'épargne et de financement - .gitignore: versionner config spec-kit unionflow Made-with: Cursor
26 lines
707 B
Dart
26 lines
707 B
Dart
library profile_di;
|
|
|
|
import 'package:get_it/get_it.dart';
|
|
import 'package:dio/dio.dart';
|
|
import '../data/repositories/profile_repository.dart';
|
|
import '../presentation/bloc/profile_bloc.dart';
|
|
|
|
class ProfileDI {
|
|
static final GetIt _getIt = GetIt.instance;
|
|
|
|
static void register() {
|
|
_getIt.registerLazySingleton<ProfileRepository>(
|
|
() => ProfileRepositoryImpl(_getIt<Dio>()),
|
|
);
|
|
|
|
_getIt.registerFactory<ProfileBloc>(
|
|
() => ProfileBloc(_getIt<ProfileRepository>()),
|
|
);
|
|
}
|
|
|
|
static void unregister() {
|
|
if (_getIt.isRegistered<ProfileBloc>()) _getIt.unregister<ProfileBloc>();
|
|
if (_getIt.isRegistered<ProfileRepository>()) _getIt.unregister<ProfileRepository>();
|
|
}
|
|
}
|