| 
									
										
										
										
											2021-07-22 17:06:53 +08:00
										 |  |  | import 'package:app_flowy/workspace/application/app/app_bloc.dart'; | 
					
						
							| 
									
										
										
										
											2021-07-24 18:55:13 +08:00
										 |  |  | import 'package:app_flowy/workspace/application/doc/doc_bloc.dart'; | 
					
						
							| 
									
										
										
										
											2021-11-10 14:46:59 +08:00
										 |  |  | import 'package:app_flowy/workspace/application/doc/share_bloc.dart'; | 
					
						
							| 
									
										
										
										
											2021-07-22 17:06:53 +08:00
										 |  |  | import 'package:app_flowy/workspace/application/menu/menu_bloc.dart'; | 
					
						
							| 
									
										
										
										
											2021-07-26 13:51:41 +08:00
										 |  |  | import 'package:app_flowy/workspace/application/menu/menu_user_bloc.dart'; | 
					
						
							| 
									
										
										
										
											2021-10-14 14:34:22 +08:00
										 |  |  | import 'package:app_flowy/workspace/application/trash/trash_bloc.dart'; | 
					
						
							| 
									
										
										
										
											2021-07-24 09:57:17 +08:00
										 |  |  | import 'package:app_flowy/workspace/application/view/view_bloc.dart'; | 
					
						
							| 
									
										
										
										
											2021-09-07 17:12:03 +08:00
										 |  |  | import 'package:app_flowy/workspace/application/workspace/welcome_bloc.dart'; | 
					
						
							| 
									
										
										
										
											2021-07-24 09:57:17 +08:00
										 |  |  | import 'package:app_flowy/workspace/domain/i_doc.dart'; | 
					
						
							| 
									
										
										
										
											2021-11-10 14:46:59 +08:00
										 |  |  | import 'package:app_flowy/workspace/domain/i_share.dart'; | 
					
						
							| 
									
										
										
										
											2021-10-14 14:34:22 +08:00
										 |  |  | import 'package:app_flowy/workspace/domain/i_trash.dart'; | 
					
						
							| 
									
										
										
										
											2021-07-24 09:57:17 +08:00
										 |  |  | import 'package:app_flowy/workspace/domain/i_view.dart'; | 
					
						
							| 
									
										
										
										
											2021-07-22 17:06:53 +08:00
										 |  |  | import 'package:app_flowy/workspace/domain/page_stack/page_stack.dart'; | 
					
						
							|  |  |  | import 'package:app_flowy/workspace/infrastructure/i_app_impl.dart'; | 
					
						
							| 
									
										
										
										
											2021-07-24 09:57:17 +08:00
										 |  |  | import 'package:app_flowy/workspace/infrastructure/i_doc_impl.dart'; | 
					
						
							| 
									
										
										
										
											2021-10-14 14:34:22 +08:00
										 |  |  | import 'package:app_flowy/workspace/infrastructure/i_trash_impl.dart'; | 
					
						
							| 
									
										
										
										
											2021-07-22 17:06:53 +08:00
										 |  |  | import 'package:app_flowy/workspace/infrastructure/i_workspace_impl.dart'; | 
					
						
							|  |  |  | import 'package:app_flowy/workspace/infrastructure/repos/app_repo.dart'; | 
					
						
							| 
									
										
										
										
											2021-07-24 09:57:17 +08:00
										 |  |  | import 'package:app_flowy/workspace/infrastructure/repos/doc_repo.dart'; | 
					
						
							| 
									
										
										
										
											2021-10-14 14:34:22 +08:00
										 |  |  | import 'package:app_flowy/workspace/infrastructure/repos/trash_repo.dart'; | 
					
						
							| 
									
										
										
										
											2021-07-24 09:57:17 +08:00
										 |  |  | import 'package:app_flowy/workspace/infrastructure/repos/view_repo.dart'; | 
					
						
							| 
									
										
										
										
											2021-07-22 17:06:53 +08:00
										 |  |  | import 'package:app_flowy/workspace/infrastructure/repos/workspace_repo.dart'; | 
					
						
							| 
									
										
										
										
											2022-01-27 20:39:54 +08:00
										 |  |  | import 'package:flowy_sdk/protobuf/flowy-folder-data-model/app.pb.dart'; | 
					
						
							|  |  |  | import 'package:flowy_sdk/protobuf/flowy-folder-data-model/view.pb.dart'; | 
					
						
							| 
									
										
										
										
											2021-07-21 15:43:05 +08:00
										 |  |  | import 'package:get_it/get_it.dart'; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-11-10 14:46:59 +08:00
										 |  |  | import 'i_share_impl.dart'; | 
					
						
							| 
									
										
										
										
											2021-07-26 11:51:39 +08:00
										 |  |  | import 'i_user_impl.dart'; | 
					
						
							| 
									
										
										
										
											2021-07-24 09:57:17 +08:00
										 |  |  | import 'i_view_impl.dart'; | 
					
						
							| 
									
										
										
										
											2021-11-10 14:46:59 +08:00
										 |  |  | import 'repos/share_repo.dart'; | 
					
						
							| 
									
										
										
										
											2021-07-24 09:57:17 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-07-21 15:43:05 +08:00
										 |  |  | class HomeDepsResolver { | 
					
						
							|  |  |  |   static Future<void> resolve(GetIt getIt) async { | 
					
						
							| 
									
										
										
										
											2021-07-22 14:06:58 +08:00
										 |  |  |     //
 | 
					
						
							| 
									
										
										
										
											2021-10-11 13:15:41 +08:00
										 |  |  |     getIt.registerLazySingleton<HomeStackManager>(() => HomeStackManager()); | 
					
						
							| 
									
										
										
										
											2021-10-14 14:34:22 +08:00
										 |  |  |     getIt.registerFactoryParam<WelcomeBloc, UserProfile, void>( | 
					
						
							|  |  |  |       (user, _) => WelcomeBloc( | 
					
						
							|  |  |  |         repo: UserRepo(user: user), | 
					
						
							| 
									
										
										
										
											2021-10-18 18:40:15 +08:00
										 |  |  |         listener: getIt<IUserListener>(param1: user), | 
					
						
							| 
									
										
										
										
											2021-10-14 14:34:22 +08:00
										 |  |  |       ), | 
					
						
							|  |  |  |     ); | 
					
						
							| 
									
										
										
										
											2021-07-22 14:06:58 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-07-22 11:23:15 +08:00
										 |  |  |     //App
 | 
					
						
							| 
									
										
										
										
											2021-10-10 15:58:57 +08:00
										 |  |  |     getIt.registerFactoryParam<IApp, String, void>((appId, _) => IAppImpl(repo: AppRepository(appId: appId))); | 
					
						
							| 
									
										
										
										
											2021-10-11 13:15:41 +08:00
										 |  |  |     getIt.registerFactoryParam<IAppListenr, String, void>( | 
					
						
							| 
									
										
										
										
											2021-10-12 13:07:41 +08:00
										 |  |  |         (appId, _) => IAppListenerhImpl(repo: AppListenerRepository(appId: appId))); | 
					
						
							| 
									
										
										
										
											2021-07-22 11:23:15 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  |     //workspace
 | 
					
						
							| 
									
										
										
										
											2021-09-04 16:53:58 +08:00
										 |  |  |     getIt.registerFactoryParam<IWorkspace, UserProfile, String>( | 
					
						
							| 
									
										
										
										
											2021-10-10 15:58:57 +08:00
										 |  |  |         (user, workspaceId) => IWorkspaceImpl(repo: WorkspaceRepo(user: user, workspaceId: workspaceId))); | 
					
						
							| 
									
										
										
										
											2021-10-12 13:07:41 +08:00
										 |  |  |     getIt.registerFactoryParam<IWorkspaceListener, UserProfile, String>((user, workspaceId) => | 
					
						
							|  |  |  |         IWorkspaceListenerImpl(repo: WorkspaceListenerRepo(user: user, workspaceId: workspaceId))); | 
					
						
							| 
									
										
										
										
											2021-07-24 09:57:17 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  |     // View
 | 
					
						
							| 
									
										
										
										
											2021-10-10 15:58:57 +08:00
										 |  |  |     getIt.registerFactoryParam<IView, View, void>((view, _) => IViewImpl(repo: ViewRepository(view: view))); | 
					
						
							| 
									
										
										
										
											2021-10-12 13:07:41 +08:00
										 |  |  |     getIt.registerFactoryParam<IViewListener, View, void>( | 
					
						
							|  |  |  |         (view, _) => IViewListenerImpl(repo: ViewListenerRepository(view: view))); | 
					
						
							| 
									
										
										
										
											2021-10-14 14:34:22 +08:00
										 |  |  |     getIt.registerFactoryParam<ViewBloc, View, void>( | 
					
						
							|  |  |  |       (view, _) => ViewBloc( | 
					
						
							| 
									
										
										
										
											2021-10-18 16:30:20 +08:00
										 |  |  |         viewManager: getIt<IView>(param1: view), | 
					
						
							| 
									
										
										
										
											2021-10-14 14:34:22 +08:00
										 |  |  |         listener: getIt<IViewListener>(param1: view), | 
					
						
							|  |  |  |       ), | 
					
						
							|  |  |  |     ); | 
					
						
							| 
									
										
										
										
											2021-07-24 09:57:17 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  |     // Doc
 | 
					
						
							| 
									
										
										
										
											2021-10-10 15:58:57 +08:00
										 |  |  |     getIt.registerFactoryParam<IDoc, String, void>((docId, _) => IDocImpl(repo: DocRepository(docId: docId))); | 
					
						
							| 
									
										
										
										
											2021-07-21 15:43:05 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-07-26 11:51:39 +08:00
										 |  |  |     // User
 | 
					
						
							| 
									
										
										
										
											2021-10-10 15:58:57 +08:00
										 |  |  |     getIt.registerFactoryParam<IUser, UserProfile, void>((user, _) => IUserImpl(repo: UserRepo(user: user))); | 
					
						
							| 
									
										
										
										
											2021-10-12 13:07:41 +08:00
										 |  |  |     getIt.registerFactoryParam<IUserListener, UserProfile, void>((user, _) => IUserListenerImpl(user: user)); | 
					
						
							| 
									
										
										
										
											2021-07-26 11:51:39 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-07-26 13:51:41 +08:00
										 |  |  |     //Menu Bloc
 | 
					
						
							| 
									
										
										
										
											2021-09-04 16:53:58 +08:00
										 |  |  |     getIt.registerFactoryParam<MenuBloc, UserProfile, String>( | 
					
						
							| 
									
										
										
										
											2021-10-18 22:08:35 +08:00
										 |  |  |       (user, workspaceId) => MenuBloc( | 
					
						
							|  |  |  |         workspaceManager: getIt<IWorkspace>(param1: user, param2: workspaceId), | 
					
						
							|  |  |  |         listener: getIt<IWorkspaceListener>(param1: user, param2: workspaceId), | 
					
						
							|  |  |  |       ), | 
					
						
							|  |  |  |     ); | 
					
						
							| 
									
										
										
										
											2021-07-22 11:23:15 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-10-10 15:58:57 +08:00
										 |  |  |     getIt.registerFactoryParam<MenuUserBloc, UserProfile, void>( | 
					
						
							| 
									
										
										
										
											2021-10-11 13:15:41 +08:00
										 |  |  |         (user, _) => MenuUserBloc(getIt<IUser>(param1: user), getIt<IUserListener>(param1: user))); | 
					
						
							| 
									
										
										
										
											2021-07-26 13:51:41 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-10-14 14:34:22 +08:00
										 |  |  |     // App
 | 
					
						
							| 
									
										
										
										
											2021-10-30 17:19:50 +08:00
										 |  |  |     getIt.registerFactoryParam<AppBloc, App, void>( | 
					
						
							|  |  |  |       (app, _) => AppBloc( | 
					
						
							|  |  |  |         app: app, | 
					
						
							|  |  |  |         appManager: getIt<IApp>(param1: app.id), | 
					
						
							|  |  |  |         listener: getIt<IAppListenr>(param1: app.id), | 
					
						
							| 
									
										
										
										
											2021-10-14 18:11:59 +08:00
										 |  |  |       ), | 
					
						
							|  |  |  |     ); | 
					
						
							| 
									
										
										
										
											2021-07-24 09:57:17 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-10-14 14:34:22 +08:00
										 |  |  |     // Doc
 | 
					
						
							| 
									
										
										
										
											2021-10-31 17:24:55 +08:00
										 |  |  |     getIt.registerFactoryParam<DocBloc, View, void>( | 
					
						
							|  |  |  |       (view, _) => DocBloc( | 
					
						
							| 
									
										
										
										
											2021-10-31 19:48:20 +08:00
										 |  |  |         view: view, | 
					
						
							| 
									
										
										
										
											2021-10-31 17:24:55 +08:00
										 |  |  |         docManager: getIt<IDoc>(param1: view.id), | 
					
						
							|  |  |  |         listener: getIt<IViewListener>(param1: view), | 
					
						
							| 
									
										
										
										
											2021-10-31 19:48:20 +08:00
										 |  |  |         trasnManager: getIt<ITrash>(), | 
					
						
							| 
									
										
										
										
											2021-10-31 17:24:55 +08:00
										 |  |  |       ), | 
					
						
							|  |  |  |     ); | 
					
						
							| 
									
										
										
										
											2021-07-24 18:55:13 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-10-14 14:34:22 +08:00
										 |  |  |     // trash
 | 
					
						
							|  |  |  |     getIt.registerLazySingleton<TrashRepo>(() => TrashRepo()); | 
					
						
							|  |  |  |     getIt.registerLazySingleton<TrashListenerRepo>(() => TrashListenerRepo()); | 
					
						
							|  |  |  |     getIt.registerFactory<ITrash>(() => ITrashImpl(repo: getIt<TrashRepo>())); | 
					
						
							|  |  |  |     getIt.registerFactory<ITrashListener>(() => ITrashListenerImpl(repo: getIt<TrashListenerRepo>())); | 
					
						
							| 
									
										
										
										
											2021-10-18 16:30:20 +08:00
										 |  |  |     getIt.registerFactory<TrashBloc>(() => TrashBloc(trasnManager: getIt<ITrash>(), listener: getIt<ITrashListener>())); | 
					
						
							| 
									
										
										
										
											2021-11-10 14:46:59 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  |     // share
 | 
					
						
							|  |  |  |     getIt.registerLazySingleton<ShareRepo>(() => ShareRepo()); | 
					
						
							|  |  |  |     getIt.registerFactory<IShare>(() => IShareImpl(repo: getIt<ShareRepo>())); | 
					
						
							|  |  |  |     getIt.registerFactoryParam<DocShareBloc, View, void>( | 
					
						
							|  |  |  |         (view, _) => DocShareBloc(view: view, shareManager: getIt<IShare>())); | 
					
						
							| 
									
										
										
										
											2021-07-21 15:43:05 +08:00
										 |  |  |   } | 
					
						
							|  |  |  | } |