Migrate the example app to material_ui - #151
Merged
Merged
Conversation
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.
Material and Cupertino were decoupled from the Flutter SDK in 3.47 into the standalone
material_ui/cupertino_uipackages. 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
example/test/widget_test.dart:package:flutter/material.dart→package:material_ui/material_ui.dart, applied withdart fix --apply --code=migrate_design_widgets(it handlesblog_tab.dart'shide Pagecorrectly).example/pubspec.yaml: addedmaterial_ui: ^1.0.0, and raisedenvironmentfromsdk: ">=3.0.3 <4.0.0"tosdk: ^3.12.0+flutter: ">=3.44.0"— whatmaterial_ui1.0.1 itself declares.pubspec.yaml(details below).The library is untouched
git diff --stat -- lib/is empty. The package keepsflutter: ">=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
MaterialAppismaterial_ui's, dependencies still on legacy Material resolveTheme.ofagainst a theme that is no longer there. Of the example's UI dependencies onlyflutter_widget_from_html_corereads it (one call site), so HTML body text on the blog tab falls back to stock Material defaults. None of them calldebugCheckHasMaterial*, so there is no assertion failure. Pulling inMaterialUiCompatibilityBridgeto 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:
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.analyzerpin — "breaks resolution on Flutter SDKs whose flutter_test pins the older meta 1.17.0". Currentflutter_testpinsmeta: ^1.18.3, so that clash is gone.Verification
flutter analyzeon the example: No issues found.flutter pub getresolves clean for both the package and the example.flutter testin the example still fails onCounter increments smoke test— but identically on unmodifiedmain, which I confirmed with a throwaway worktree at HEAD. It is the stock template test pumping the real app, which needs.envShopify 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.ymlships Dart 3.10.0, andmaterial_uirequires Dart^3.12.0/ Flutter>=3.44.0— soflutter pub getfails 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 verifieddart analyze --fatal-infosgreen on (clean checkout of this branch, freshpub 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.