feat(config): inject a Firebase integration strategy (Firebase-free embedding)#1445
Merged
Conversation
…mbedding) Let the app run Firebase-free when a host owns the default Firebase app (the theme configurator's realtime preview, which mounts this app in-process), without a feature-flag boolean or scattered conditionals. Whether Firebase is wired is a single polymorphic choice made by the composition root. - Add FirebaseIntegration: a strategy bundling the Firebase-dependent pieces (platform init, app-id provider, remote config, analytics). bootstrap takes one (default FirebaseIntegrationEnabled) and consumes it uniformly, no branching. - FirebaseIntegrationDisabled is the Firebase-free strategy (no platform init, local id provider, local cache as remote config, no-op analytics). An embedder passes it to bootstrap(); no env override. - AppAnalyticsRepository becomes an interface with FirebaseAppAnalyticsRepository and NoopAppAnalyticsRepository (a plain, recording-nothing observer), so App attaches the observer unconditionally - no Firebase-aware gate in the widget. - bootstrap registers the analytics repository; main.dart reads it from the registry instead of constructing FirebaseAnalytics.instance directly. Standalone behaviour is unchanged (default = FirebaseIntegrationEnabled).
01c165d to
5c0a90b
Compare
digiboridev
approved these changes
Jun 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
Lets the app run Firebase-free when a host owns the default Firebase app — the theme configurator's realtime preview, which mounts this app in-process — without any feature-flag boolean or scattered conditionals.
Whether Firebase is wired is a single polymorphic choice made by the composition root, expressed as an injected strategy, rather than a flag read in several places.
Changes
FirebaseIntegration— a strategy bundling the Firebase-dependent pieces: platform init (app / messaging / local pushes), app-id provider, remote config, analytics.bootstraptakes one (defaultFirebaseIntegrationEnabled) and consumes it uniformly — noif (firebaseEnabled)branches.FirebaseIntegrationDisabled— the Firebase-free strategy: no platform init,SharedPreferencesAppIdProvider, the local cache as the remote config source, no-op analytics. An embedder callsbootstrap(firebase: const FirebaseIntegrationDisabled())— no env override needed.AppAnalyticsRepositoryis now an interface withFirebaseAppAnalyticsRepositoryandNoopAppAnalyticsRepository(a plain, recording-nothing observer), soAppattaches the observer unconditionally — no Firebase-aware gate in the widget layer.bootstrapregisters the analytics repository;main.dartreads it from the registry instead of constructingFirebaseAnalytics.instancedirectly.No dart-define, no docs flag entry, no flag test — the choice lives in code at the composition root.
Verification
flutter analyze— clean.FirebaseIntegrationEnabled).