fix: migrate to material_ui and cupertino_ui packages - #207
Conversation
qeepcologne
left a comment
There was a problem hiding this comment.
+1 — straightforward, and it matches what we did in our own apps (same dart fix --apply --code=migrate_design_widgets route). We are running this branch pinned by commit in an app right now, so it works end to end.
One nit: the SDK floor is raised further than anything here needs. The PR goes to flutter: ">=3.47.0" / sdk: ">=3.13.0", but every 1.x of both new dependencies declares:
environment:
sdk: ^3.12.0
flutter: ">=3.44.0"That holds for material_ui 1.0.0 through 1.2.0 and cupertino_ui 1.0.0 through 1.0.2 — nothing in the dependency graph asks for 3.47. Checked by lowering the constraints to sdk: ">=3.12.0 <4.0.0" / flutter: ">=3.44.0" and running flutter pub downgrade to force the lowest allowed versions (material_ui 1.1.1, cupertino_ui 1.0.2): flutter analyze lib/ is clean. Caveat on that check — it ran on Flutter 3.47.4, so the analyzer enforced language version 3.12 (which would catch newer syntax) but did not compile against the 3.44 framework. Given the diff is import swaps only and the code itself is unchanged from a base that supported >=3.16.0, that seems safe.
Worth lowering because >=3.47.0 locks out every consumer on 3.44–3.46 who could otherwise take the migrated package, and those are exactly the users who benefit: material_ui works alongside the still-present in-SDK Material on those versions.
(The flutter_lints: ^6.0.0 bump is dev-only, so it does not affect consumers either way.)
|
Yeah that makes sense, give me a quick sec |
|
@yadaniyil is anything still blocking this one? From the outside it looks ready:
We have been running this branch pinned by commit in a shipping app since it was opened, so the migration works end to end. Would you be able to merge it and cut a release? Everyone on the published 3.0.1 currently cannot build against |
SettingsList now reads Theme and CupertinoTheme from material_ui and cupertino_ui. In an app still on package:flutter/material it silently falls back to default colors, so print a one-time hint in debug builds. Adds tests that colors, dark mode and platform follow a material_ui / cupertino_ui app theme (yako-dev#206). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Document the new Flutter 3.44 / material_ui requirement and point apps that have not migrated to settings_ui ^3.0.1. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
flutter format was removed from Flutter, so the Code Quality job failed on every push. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
iOS 27 requires the UIScene lifecycle, so the example would not launch. Regenerated example/ios from the current Flutter template (same bundle ID and app icons). Also fixes the dark mode integration test, which expected a Material Switch where iOS shows a CupertinoSwitch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Merged — thanks a lot @SlayerOrnstein for the migration, and @qeepcologne for the review and for testing it in a real app. That really helped. Before merging I added a few commits on top:
Tested on Android and iOS, light and dark: all example screens look the same as 3.0.1, and all tests pass on Flutter 3.44 and 3.47. It'll go out as 4.0.0 on pub.dev. |
|
settings_ui 4.0.0 with your |
…the docs - 3.x never upper-cased iOS headers; apps passed ALL-CAPS titles. - Breaking changes: Linux tests must find AdwaitaSettingsSwitch, and the default side padding follows the list's width. - Credit yako-dev#207 and yako-dev#201/yako-dev#202, link the old macOS, Windows and iPad requests. - Documentation: the README rewrite, llms.txt and AGENTS.md. Example app: the showcase screen, and `cd example` before --route. - The date stays Unreleased until the day of publishing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Connection with issue(s)
Resolve issue #206
Connected to #???
Testing and Review Notes
Bumped the constraints for both Flutter and Dart SDK to the initial decoupling then ran
dart fix --apply --code=migrate_design_widgetsMade sure to run test and check out the examples, I also wasn't sure but I made sure the abstract classes imported widgets from flutter instead of the ui packages
Screenshots or Videos
To Do