AppBootstrap constructor

AppBootstrap({
  1. AuthModule<Object> auth = const AnonymousAuthModule(),
  2. required RoutingModule routing,
  3. AppInfoModule appInfo = const DefaultAppInfoModule(),
  4. DeviceInfoModule deviceInfo = const DefaultDeviceInfoModule(),
  5. UserPrefsModule userPrefs = const DefaultUserPrefsModule(),
  6. LocalizationModule localization = const DefaultLocalizationModule(),
  7. AnalyticsModule analyticsInit = const DefaultAnalyticsModule(),
  8. PushNotificationModule? pushNotifications,
  9. InjectionModule injection = const ProviderInjectionModule(),
  10. TabSet? tabs,
  11. VersionCheckSettings? versionCheckSettings,
  12. bool isChangeBrightness = true,
  13. FirebaseApp? firebaseApp,
  14. Future completeStage1(
    1. LifecycleInit? init
    )? = defaultCompleteStage1,
  15. required String identifier,
  16. Widget buildPlatformApp(
    1. BuildContext context,
    2. Widget app
    ) = defaultBuildPlatformApp,
  17. FRouter? router,
  18. void initWithinApp(
    1. BuildContext context
    )?,
  19. void initWithinNavigator(
    1. BuildContext context
    )?,
  20. void onUnauthenticatedError(
    1. BuildContext context
    ) = noopBuildContext,
  21. Widget loggedInWidget(
    1. UserDetails profile
    )?,
  22. Getter<Widget>? loggedOutWidget,
  23. Getter<Widget>? splashPageWidget,
  24. required String appTitle,
  25. String? baseApiUrl,
  26. Widget buildOuterContext(
    1. Widget inner
    ) = defaultBuildOuterContext,
  27. ThemesBuilder themesBuilder = buildDefaultThemes,
  28. List<LoginProvider> loginProviders = const [],
  29. Stream<ErrorStack>? appErrors,
  30. ScreenInit screenInit = defaultScreenInit,
  31. 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();