| j / k | Scroll down / up |
| gg | Scroll to top |
| G | Scroll to bottom |
| / | Open search |
| ? | Show this help |
| Esc | Close search / help |
| n / N | Next / previous section |
| h | Go to landing |
| d | Go to docs |
| : | Command mode — type section name |
Press ? or Esc to close
Core services registered once at bootstrap. Feature DI is lazy — registered on route entry, unregistered on pop.
// app/app_bootstrap.dart
void bootstrap() {
sl.registerSingleton(ApiClient());
sl.registerSingleton(AppDatabase());
sl.registerLazySingleton(() => GlobalErrorCubit());
sl.registerLazySingleton(() => ThemeCubit());
sl.registerLazySingleton(() => LocalizationCubit(sl()));
}// features/profile/config/profile_di.dart
void registerProfileDependencies() {
sl.registerLazySingleton(() => ProfileDataSource(sl()));
sl.registerLazySingleton(() => ProfileLocal(sl()));
sl.registerLazySingleton(() => ProfileStore(sl(), sl()));
sl.registerFactory(() => ProfileCubit(sl()));
}
void unregisterProfileDependencies() {
sl.unregister();
sl.unregister();
sl.unregister();
} | Reason | Benefit |
|---|---|
| Faster startup | Nothing created until the feature is actually entered |
| Lower memory | Dependencies destroyed when the user leaves the feature |
| True isolation | No feature can depend on another's internals |