Skip to content

task(deps): migrate to the standalone material_ui and cupertino_ui packages #8916

Closed

Description

@hm21

Context

Material and Cupertino are no longer part of the Flutter framework. They now ship as the pub packages material_ui and cupertino_ui, maintained in flutter/packages.

package:flutter/material.dart still exists in Flutter 3.47.2, so this is available rather than forced — the app builds and the full suite passes without it. But the framework copy is the legacy path now, and the longer we sit on it the more third-party packages move across underneath us.

Deliberately kept out of the Flutter 3.47.2 bump (#8915) to keep that PR reviewable: the bump is 405 files, this would add roughly 1350 more and mix a framework migration into a toolchain change.

Why this is not the one command the README implies

The material_ui README presents step 1 as dart fix --apply --code=migrate_design_widgets. That part is real and it works — but measured against this repo, two of the three README steps also apply, and there is a fourth thing the README cannot know about.

Step 1 — imports. 1346 files under mobile/ import package:flutter/material.dart; the fix proposes 1342 changes. Mechanical, but it is the whole app plus every package.

Step 2 — localizations. Applies here. GlobalMaterialLocalizations is referenced in 9 places, including the generated lib/l10n/generated/app_localizations.dart and divine_ui. Those classes move to material_ui / cupertino_ui.

Step 3 — compatibility bridge. Applies here. Third-party packages that still import package:flutter/material.dart need MaterialUiCompatibilityBridge wired through MaterialApp.builder so ThemeData and MaterialLocalizations resolve inside modern widget trees. pro_video_editor alone has 234 such files. This touches app bootstrap, so it wants its own thought rather than a find-and-replace.

Step 4 — our own guards. Not in the README. Several ratchet detectors are Dart AST passes keyed on the MaterialApp / CupertinoApp / WidgetsApp types — check_l10n_delegates_ceiling.sh and the design-system ceilings (check_raw_dialog_ceiling.sh, check_material_button_ceiling.sh). Once those types resolve to material_ui, an unchanged detector matches nothing and silently reports a clean file. Every guard that names a Material type has to be re-pointed, and its pinned test in mobile/test/tools/ updated with it.

Notes for whoever picks this up

  • The fix data ships with the material_ui package, not the Flutter SDK. Grepping the SDK for migrate_design_widgets finds nothing, which makes the code look nonexistent — it is discovered once material_ui is a dependency.
  • material_ui 1.1.1 declares flutter: ">=3.44.0", so it is compatible with our pin either way.
  • divine_ui gates at 100% coverage and is one of the migrated packages, so its own suite moves with it.
  • Worth splitting the mechanical import rewrite into its own commit, the way chore(deps): upgrade to Flutter 3.47.2 and drop the freezed models it breaks #8915 isolated the formatter churn, so review can skip it and focus on steps 2–4.

Done when

  • The app and every package under mobile/packages/ build against material_ui / cupertino_ui
  • Localization delegates come from the new packages and the l10n suite passes
  • Third-party consumers still on package:flutter/material.dart render correctly through the bridge
  • Every AST detector that names a Material type has been re-pointed, with its pinned test updated
  • Full Mobile CI green, and a device smoke test on a real Samsung Galaxy covering camera, recording, upload and feed playback

Activity

  1. self-assigned this
    on Sep 8, 2026
  2. moved this from Triage to In progress in Divine programon Sep 10, 2026
  3. 25 remaining items

  4. moved this from In progress to Testing in Divine programon Sep 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions