Problem
Production (non-demo) code structurally imports from lib/demo/, so the demo/ directory is no longer demo-only — it is a production dependency. This is confusing for navigation and blocks cleanly separating demo-only scaffolding from shipping code.
Current production → lib/demo/ imports
| Production file |
Imported demo module |
lib/app.dart |
demo/providers/theme_studio_config_provider.dart |
lib/app.dart |
demo/theme_studio/studio_theme_builder.dart |
lib/page/shell/usp_dashboard_shell.dart |
demo/providers/theme_studio_config_provider.dart |
lib/page/shell/usp_dashboard_shell.dart |
demo/providers/demo_ui_provider.dart |
lib/page/shell/usp_dashboard_shell.dart |
demo/theme_studio/studio_theme_builder.dart |
lib/page/shell/usp_dashboard_shell.dart |
demo/theme_studio/theme_studio_panel.dart |
lib/page/shell/usp_top_bar.dart |
demo/providers/theme_studio_config_provider.dart |
lib/page/shell/usp_top_bar.dart |
demo/theme_studio/studio_theme_builder.dart |
lib/page/dashboard/mascot/mascot_providers.dart |
demo/providers/demo_ui_provider.dart |
So production depends on this demo-resident set:
theme_studio_config_provider.dart (the Theme Studio config ThemeStudioConfig / provider)
studio_theme_builder.dart (buildStudioThemeData / mergeStudioConfigJson)
theme_studio_panel.dart (the panel, gated by GlobalConfig.feature.enableThemeStudio)
demo_ui_provider.dart
Why now
While fixing the Theme Studio theme-clobber bug (nullable style/visualEffects so device/THEME_JSON theme is honored), the symbols were renamed DemoThemeConfig → ThemeStudioConfig etc. The naming no longer matches the demo/ location, which surfaced this layering issue. Moving files was intentionally deferred to keep that fix focused.
Proposed direction (to be scoped)
Extract the production-consumed pieces out of lib/demo/ into a production home, e.g.:
theme_studio_config_provider.dart + studio_theme_builder.dart → lib/theme/ (or lib/providers/)
theme_studio_panel.dart → a lib/theme/studio/ (it is a real feature gated by enableThemeStudio, not demo-only)
- Re-evaluate
demo_ui_provider.dart: split the production-needed parts from the demo-only parts.
Leave genuinely demo-only code (demo_app.dart, demo/usp/, demo/pages/, scenario picker) in lib/demo/.
Notes
DemoLinksysApp (lib/demo/demo_app.dart) is genuinely demo-only and should stay in lib/demo/.
- This is a behavior-preserving move + import-path update; guard with
flutter analyze and the full functional suite.
- Related: Theme Studio clobber fix on branch
feat/e2e-usp-transport.
Problem
Production (non-demo) code structurally imports from
lib/demo/, so thedemo/directory is no longer demo-only — it is a production dependency. This is confusing for navigation and blocks cleanly separating demo-only scaffolding from shipping code.Current production →
lib/demo/importslib/app.dartdemo/providers/theme_studio_config_provider.dartlib/app.dartdemo/theme_studio/studio_theme_builder.dartlib/page/shell/usp_dashboard_shell.dartdemo/providers/theme_studio_config_provider.dartlib/page/shell/usp_dashboard_shell.dartdemo/providers/demo_ui_provider.dartlib/page/shell/usp_dashboard_shell.dartdemo/theme_studio/studio_theme_builder.dartlib/page/shell/usp_dashboard_shell.dartdemo/theme_studio/theme_studio_panel.dartlib/page/shell/usp_top_bar.dartdemo/providers/theme_studio_config_provider.dartlib/page/shell/usp_top_bar.dartdemo/theme_studio/studio_theme_builder.dartlib/page/dashboard/mascot/mascot_providers.dartdemo/providers/demo_ui_provider.dartSo production depends on this demo-resident set:
theme_studio_config_provider.dart(the Theme Studio configThemeStudioConfig/ provider)studio_theme_builder.dart(buildStudioThemeData/mergeStudioConfigJson)theme_studio_panel.dart(the panel, gated byGlobalConfig.feature.enableThemeStudio)demo_ui_provider.dartWhy now
While fixing the Theme Studio theme-clobber bug (nullable
style/visualEffectsso device/THEME_JSON theme is honored), the symbols were renamedDemoThemeConfig→ThemeStudioConfigetc. The naming no longer matches thedemo/location, which surfaced this layering issue. Moving files was intentionally deferred to keep that fix focused.Proposed direction (to be scoped)
Extract the production-consumed pieces out of
lib/demo/into a production home, e.g.:theme_studio_config_provider.dart+studio_theme_builder.dart→lib/theme/(orlib/providers/)theme_studio_panel.dart→ alib/theme/studio/(it is a real feature gated byenableThemeStudio, not demo-only)demo_ui_provider.dart: split the production-needed parts from the demo-only parts.Leave genuinely demo-only code (
demo_app.dart,demo/usp/,demo/pages/, scenario picker) inlib/demo/.Notes
DemoLinksysApp(lib/demo/demo_app.dart) is genuinely demo-only and should stay inlib/demo/.flutter analyzeand the full functional suite.feat/e2e-usp-transport.