Skip to content

Migrate the example app to material_ui - #151

Merged
imsujan276 merged 3 commits into
imsujan276:mainfrom
qeepcologne:example-material-ui
Aug 27, 2026
Merged

Migrate the example app to material_ui#151
imsujan276 merged 3 commits into
imsujan276:mainfrom
qeepcologne:example-material-ui

Conversation

@qeepcologne

@qeepcologne qeepcologne commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Material and Cupertino were decoupled from the Flutter SDK in 3.47 into the standalone material_ui / cupertino_ui packages. The in-SDK copies still work — they are frozen to contributions and scheduled for removal, with no date — so this is not urgent, but the example is the part of the repo people copy from, and it is the cheapest thing to move.

What changed

  • 13 example sources + example/test/widget_test.dart: package:flutter/material.dartpackage:material_ui/material_ui.dart, applied with dart fix --apply --code=migrate_design_widgets (it handles blog_tab.dart's hide Page correctly).
  • example/pubspec.yaml: added material_ui: ^1.0.0, and raised environment from sdk: ">=3.0.3 <4.0.0" to sdk: ^3.12.0 + flutter: ">=3.44.0" — what material_ui 1.0.1 itself declares.
  • Dropped two stale comments from the package pubspec.yaml (details below).

The library is untouched

git diff --stat -- lib/ is empty. The package keeps flutter: ">=1.17.0" and every dependency constraint is unchanged, so consumers are unaffected — only someone running the example needs Flutter 3.44+.

Known cosmetic effect

Once the example's MaterialApp is material_ui's, dependencies still on legacy Material resolve Theme.of against a theme that is no longer there. Of the example's UI dependencies only flutter_widget_from_html_core reads it (one call site), so HTML body text on the blog tab falls back to stock Material defaults. None of them call debugCheckHasMaterial*, so there is no assertion failure. Pulling in MaterialUiCompatibilityBridge to paper over one text style seemed worse than the fallback for a demo app.

Stale comments removed

Both were describing conditions that no longer hold:

  • on intl — "flutter_localizations (Flutter SDK) pins intl to exactly 0.20.2". It declares ^0.20.3, and has since Roll pub packages (#188764) on 2026-06-29; the exact pin was dropped for good on 2026-04-21. The constraint itself is unchanged.
  • on the absent analyzer pin — "breaks resolution on Flutter SDKs whose flutter_test pins the older meta 1.17.0". Current flutter_test pins meta: ^1.18.3, so that clash is gone.

Verification

  • flutter analyze on the example: No issues found.
  • flutter pub get resolves clean for both the package and the example.
  • flutter test in the example still fails on Counter increments smoke test — but identically on unmodified main, which I confirmed with a throwaway worktree at HEAD. It is the stock template test pumping the real app, which needs .env Shopify credentials: ShopifyStore.getNProducts (shopify_store.dart:215:52) Null check operator used on a null value. Untouched here.

CI has to move too

The pinned flutter-version: '3.38.2' in .github/workflows/analyzer.yml ships Dart 3.10.0, and material_ui requires Dart ^3.12.0 / Flutter >=3.44.0 — so flutter pub get fails the job outright with "Because example requires SDK version ^3.12.0, version solving failed". There is no way to keep the migration and the old pin; I bumped it to 3.47.1 in a separate commit, which is the version I verified dart analyze --fatal-infos green on (clean checkout of this branch, fresh pub get, no local overrides). 3.44.0 is the true floor if you would rather move the minimum — I did not test that one, so I pinned what I actually ran.

If bumping your supported Flutter is not something you want to do right now, this PR is not worth it yet and I am happy to close it — the in-SDK Material still works and has no removal date.

Happy to split the comment removal out, or to drop the version bump if you would rather batch this into a later release.

@imsujan276
imsujan276 merged commit cabe3c9 into imsujan276:main Aug 27, 2026
2 checks passed
@qeepcologne
qeepcologne deleted the example-material-ui branch August 28, 2026 07:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants