feat(app): support running embedded in a host (embeddedPreview + injection)#1437
Closed
SERDUN wants to merge 1 commit into
Closed
feat(app): support running embedded in a host (embeddedPreview + injection)#1437SERDUN wants to merge 1 commit into
SERDUN wants to merge 1 commit into
Conversation
…ction)
Let webtrit_phone run embedded inside another Flutter host (the theme
configurator's realtime preview).
- bootstrap({embeddedPreview}) runs Firebase-free: skip Firebase app/messaging/
local-push init, use SharedPreferencesAppIdProvider instead of the
Installations-backed one, and skip Firebase Remote Config. Needed because the
host owns the default Firebase app, which may be misconfigured/absent.
- RootApp/App accept external ThemeSettings/ThemeMode/FeatureAccess streams
(+ initial seeds) so the host drives the live appearance and feature/login/tab
config; theme is applied via AppThemeSettingsChanged/AppThemeModeChanged
(no prefs write).
- The analytics provider is lazy and the analytics navigator observer is skipped
when embedded, so FirebaseAnalytics.instance is never touched.
Standalone behaviour is unchanged: embeddedPreview defaults to false and all
external streams default to null.
Member
Author
|
Splitting into two PRs: (1) embeddedPreview Firebase-free bootstrap, (2) external Theme/FeatureAccess injection. |
This was referenced Jun 23, 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
Let
webtrit_phonerun embedded inside another Flutter host — the theme configurator's realtime preview mounts the real app in-process. Two parts, both inbootstrap.dart/main.dart(RootApp) /app/view/app.dart(App):bootstrap({bool embeddedPreview = false}): when embedded, skip Firebase app/messaging/local-push init, useSharedPreferencesAppIdProviderinstead of the Installations-backedFirebaseAppIdProvider, and skip Firebase Remote Config. The host owns the default Firebase app (which may be misconfigured or absent — locally the configurator's app has an emptyprojectId), so any Firebase touch in the embedded app would throw.RootApp/Appaccept externalThemeSettings/ThemeMode/FeatureAccessstreams (+ initial seeds) so the host drives the live appearance and feature/login/tab config. Theme is applied viaAppThemeSettingsChanged/AppThemeModeChanged(no prefs write); theFeatureAccessStreamProvidersource is swapped to the external stream. The analytics provider is made lazy and the analytics navigator observer is skipped when embedded, soFirebaseAnalytics.instanceis never touched.Why
Part of the configurator realtime-preview epic (depends on the EnvironmentConfig runtime-override PR for the dart-define injection path the host uses). Standalone builds are unaffected.
Notes
embeddedPreviewdefaults tofalse, all external streams default tonull.flutter analyze libgreen.