mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
25 lines
970 B
Dart
25 lines
970 B
Dart
import 'package:app_flowy/home/application/menu/menu_bloc.dart';
|
|
import 'package:app_flowy/home/infrastructure/i_app_impl.dart';
|
|
import 'package:app_flowy/home/infrastructure/i_workspace_impl.dart';
|
|
import 'package:app_flowy/home/infrastructure/repos/app_repo.dart';
|
|
import 'package:app_flowy/home/infrastructure/repos/workspace_repo.dart';
|
|
import 'package:get_it/get_it.dart';
|
|
|
|
class HomeDepsResolver {
|
|
static Future<void> resolve(GetIt getIt) async {
|
|
getIt.registerLazySingleton<WorkspaceRepository>(
|
|
() => WorkspaceRepository());
|
|
|
|
getIt.registerFactoryParam<AppRepository, String, void>(
|
|
(appId, _) => AppRepository(appId: appId));
|
|
|
|
//Interface implementation
|
|
getIt.registerFactory<IApp>(() => IAppImpl(repo: getIt<AppRepository>()));
|
|
getIt.registerFactory<IWorkspace>(
|
|
() => IWorkspaceImpl(repo: getIt<WorkspaceRepository>()));
|
|
|
|
//Bloc
|
|
getIt.registerFactory<MenuBloc>(() => MenuBloc(getIt<IWorkspace>()));
|
|
}
|
|
}
|