import 'dart:async'; import 'package:cake_wallet/reactions/on_current_node_change.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/widgets.dart'; import 'package:shared_preferences/shared_preferences.dart'; import 'package:cake_wallet/di.dart'; import 'package:cake_wallet/entities/preferences_key.dart'; import 'package:cake_wallet/reactions/on_authentication_state_change.dart'; import 'package:cake_wallet/reactions/on_current_fiat_change.dart'; import 'package:cake_wallet/reactions/on_current_wallet_change.dart'; import 'package:cake_wallet/store/app_store.dart'; import 'package:cake_wallet/store/settings_store.dart'; import 'package:cake_wallet/store/authentication_store.dart'; import 'package:cake_wallet/store/dashboard/fiat_conversion_store.dart'; Future bootstrap(GlobalKey navigatorKey) async { final appStore = getIt.get(); final authenticationStore = getIt.get(); final settingsStore = getIt.get(); final fiatConversionStore = getIt.get(); if (authenticationStore.state == AuthenticationState.uninitialized) { final currentWalletName = getIt .get() .getString(PreferencesKey.currentWalletName); authenticationStore.state = currentWalletName == null ? AuthenticationState.denied : AuthenticationState.installed; } startAuthenticationStateChange(authenticationStore, navigatorKey); startCurrentWalletChangeReaction( appStore, settingsStore, fiatConversionStore); startCurrentFiatChangeReaction(appStore, settingsStore); startOnCurrentNodeChangeReaction(appStore); }