- 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
779 B
Dart
26 lines
779 B
Dart
library notifications_di;
|
|
|
|
import 'package:get_it/get_it.dart';
|
|
import 'package:dio/dio.dart';
|
|
import '../data/repositories/notification_repository.dart';
|
|
import '../presentation/bloc/notifications_bloc.dart';
|
|
|
|
class NotificationsDI {
|
|
static final GetIt _getIt = GetIt.instance;
|
|
|
|
static void register() {
|
|
_getIt.registerLazySingleton<NotificationRepository>(
|
|
() => NotificationRepositoryImpl(_getIt<Dio>()),
|
|
);
|
|
|
|
_getIt.registerFactory<NotificationsBloc>(
|
|
() => NotificationsBloc(_getIt<NotificationRepository>()),
|
|
);
|
|
}
|
|
|
|
static void unregister() {
|
|
if (_getIt.isRegistered<NotificationsBloc>()) _getIt.unregister<NotificationsBloc>();
|
|
if (_getIt.isRegistered<NotificationRepository>()) _getIt.unregister<NotificationRepository>();
|
|
}
|
|
}
|