mobx
root store
void main() { WidgetsFlutterBinding.ensureInitialized(); buildStore(); runApp(MyApp()); } void buildStore() { var rootStore = addStore(RootStore()); addStore(SettingStore(rootStore), rootStore); addStore(PantryStore(rootStore), rootStore); rootStore.init(); } T addStore<T extends Object>(T store, [rootStore]) { if (rootStore != null) rootStore.store = store; GetIt.instance.registerSingleton<T>(store); return store; }
관련 문서
Plugin Backlinks: 아무 것도 없습니다.