app/startup/dreamic_bootstrap library

Functions

dreamicBootstrap({required FirebaseOptions firebaseOptions, required DreamicServicesInitializer servicesInitializer, Map<String, dynamic>? additionalRemoteConfigDefaults, DreamicBootstrapHook? afterFirebaseInit, DreamicBootstrapHook? registerBeforeServices, DreamicBootstrapHook? registerAfterServices, DreamicBootstrapHook? captureEntryIntents, bool appCubitNetworkRequired = true, Uri? appCubitEntranceUri, Duration? bootstrapTimeout = const Duration(seconds: 45), bool? attachErrorReportingFirst, Duration? firebaseInitTimeout = const Duration(seconds: 30), Duration? firebaseRecoverIfRegisteredAfter = const Duration(seconds: 4), AppCheckConfig? appCheck}) Future<void>
Runs the cold-start init chain that today sits in main() — Firebase, error backend attach, remote config, app configs base, emulator connect, DreamicServices.initialize, appInitAppCubit — now behind the splash rather than before runApp. Returns a single Future<void> the DreamicAppInitHost/DreamicAppInitGate gates the router on.
resetDreamicBootstrapIdempotencyForTest() → void
Resets the dreamic-core bootstrap idempotency apply-once flags between test cases (Issue 63/87). Module-level statics persist across cases in one VM, so without this the "fresh-run applies / re-run skips" assertions become order-dependent.
resolveAttachErrorReportingFirst(bool? explicitOverride) bool
Resolves whether to attach the error reporter BEFORE Firebase init.
runBoundedNonCritical(Future<void> work(), {required Duration timeout, required String label}) Future<void>
Runs non-critical work inside a bootstrap hook with a hard timeout, swallowing any failure (a throw OR the timeout) so it can NEVER abort or stall the bootstrap.

Typedefs

DreamicBootstrapHook = FutureOr<void> Function()
A plain FutureOr<void> hook the consuming app composes into the bootstrap sequence. Hooks run at fixed ordering points (see dreamicBootstrap) and must be idempotent — they re-run on every gate retry.
DreamicServicesInitializer = Future<DreamicServicesResult> Function(FirebaseApp firebaseApp)
App-supplied services initializer. Called at the services step with the initialized FirebaseApp; the app calls DreamicServices.initialize(...) with its own auth-lifecycle and notification callbacks and returns the result.