AppBootstrap constructor
AppBootstrap({
- AuthModule<
Object> auth = const AnonymousAuthModule(), - required RoutingModule routing,
- AppInfoModule appInfo = const DefaultAppInfoModule(),
- DeviceInfoModule deviceInfo = const DefaultDeviceInfoModule(),
- UserPrefsModule userPrefs = const DefaultUserPrefsModule(),
- LocalizationModule localization = const DefaultLocalizationModule(),
- AnalyticsModule analyticsInit = const DefaultAnalyticsModule(),
- PushNotificationModule? pushNotifications,
- InjectionModule injection = const ProviderInjectionModule(),
- TabSet? tabs,
- VersionCheckSettings? versionCheckSettings,
- bool isChangeBrightness = true,
- FirebaseApp? firebaseApp,
- Future completeStage1(
- LifecycleInit? init
- required String identifier,
- Widget buildPlatformApp(
- BuildContext context,
- Widget app
- FRouter? router,
- void initWithinApp(
- BuildContext context
- void onUnauthenticatedError(
- BuildContext context
- Widget loggedInWidget(
- UserDetails profile
- Getter<
Widget> ? loggedOutWidget, - Getter<
Widget> ? splashPageWidget, - required String appTitle,
- String? baseApiUrl,
- Widget buildOuterContext(
- Widget inner
- ThemesBuilder themesBuilder = buildDefaultThemes,
- List<
LoginProvider> loginProviders = const [], - Stream<
ErrorStack> ? appErrors, - ScreenInit screenInit = defaultScreenInit,
- Future<
bool> onPreLogout()?,
Implementation
AppBootstrap(
{this.auth = const AnonymousAuthModule(),
required this.routing,
this.appInfo = const DefaultAppInfoModule(),
this.deviceInfo = const DefaultDeviceInfoModule(),
this.userPrefs = const DefaultUserPrefsModule(),
this.localization = const DefaultLocalizationModule(),
this.analyticsInit = const DefaultAnalyticsModule(),
this.pushNotifications,
/// Plugs into [Sunny] to handle service resolution. This allows for a
/// swappable strategy that may use `provider` or `kiwi`. By default,
/// this uses the Provider package
this.injection = const ProviderInjectionModule(),
this.tabs,
/// Set this if you want to check if this version of the app is too old
this.versionCheckSettings,
// /// API key to be used for making calls to google
// @required this.googleApiKey,
//
// /// API key to be used for making calls to google
// @required this.googleSignInClientId,
/// Whether the app should attempt to change brightness
this.isChangeBrightness = true,
/// The initialized firebase app
this.firebaseApp,
/// Executes code at the end of stage1, before anything Flutter related
/// loads. This gives a chance to do any pre-work before Widgets start flying.
///
/// If the return value is a [SingleChildWidget] ([Provider]) or variant, it will
/// be added to the top-level multi-provider
this.completeStage1 = defaultCompleteStage1,
/// App identifier. Used to prefix preferences, among other things
required this.identifier,
/// Builds the innerMost widget, wrapping the PlatformApp
this.buildPlatformApp = defaultBuildPlatformApp,
/// The fluro router to use for path resolution
this.router,
/// Executes once within the PlatformApp component
this.initWithinApp,
/// Executes once within the PlatformApp component
this.initWithinNavigator,
/// Executes when an unauthenticated exception occurs, allows you
/// to swap for a login screen
this.onUnauthenticatedError = noopBuildContext,
/// The widget to display when logged in
this.loggedInWidget,
/// The widget to display when logged out
this.loggedOutWidget,
/// The widget to display when logged out
this.splashPageWidget,
/// The title of the app
required this.appTitle,
/// The base API url for this app
this.baseApiUrl,
/// Builds the outer widget
this.buildOuterContext = defaultBuildOuterContext,
/// Builds the app themes, based on brightness
this.themesBuilder = buildDefaultThemes,
/// Login providers to use
this.loginProviders = const [],
/// A stream of errors that bubbled up to the top level
Stream<ErrorStack>? appErrors,
/// Executed when the screen changes sizes
this.screenInit = defaultScreenInit,
/// Runs right before the user logs out. Useful for doing any cleanup
/// before cleaning up state
this.onPreLogout})
: appErrors = appErrors ?? Stream.empty();