Refactor/migrate material cupertino UI - #862
Conversation
Fix `createState()` returning the private state class in `BarColorPicker` and `LayerWidget`, which broke `flutter analyze` on the generated Mockito mocks and triggered `library_private_types_in_public_api`. Returning `State<T>` again also removes the need for the `unsupportedMembers` workaround in the mock spec. Regenerate the stale Mockito mocks so they reference `material_ui`, drop a duplicate import, and repair the import-section comments that the migration displaced. Pin `material_ui` and `cupertino_ui` instead of `any`, and bump to 14.0.0 since consumers must migrate their own Material and Cupertino imports.
|
Thanks a lot for this PR! 🙏 The migration itself is complete and clean — I verified that no I pushed one follow-up commit onto your branch to get CI green and to prepare the release: Analyzer error (the actual CI failure)
_BarColorPickerState createState() => _BarColorPickerState();That is what broke the build. It triggered Restoring Stale generated mocks
Version constraints
Version bump + changelog This is a genuine breaking change, not just an internal refactor. On the current stable channel (3.44, which CI pins) Since Minor cleanups Removed a duplicate Result: |
Resolve the version and changelog conflicts in favour of 14.0.0 and keep the 13.6.0 paint-editor entries as their own section, and migrate the `package:flutter/material.dart` import that arrived with hm21#863.
|
Follow-up:
The PR is |
25a8f94 to
aa7098e
Compare
CI pinned Flutter 3.44.0 only, so it never exercised the version this migration is for. Run analyze and test as a matrix over both ends of the supported range: 3.44.0, the minimum declared in `environment`, and 3.47, where Material and Cupertino ship as separate packages. Move the format check into its own job so it cannot silently skip when the matrix changes, and build GitHub Pages with 3.47 as well. Bump `actions/checkout` to v5, which runs on Node 24 and drops the Node 20 deprecation warning.
`dart format` reads analysis_options.yaml, whose `include` points at a lint set shipped in a package. Without `flutter pub get` that include fails to resolve, the formatter silently falls back to its defaults and wants to reformat 107 files.
|
One more round — the CI workflows themselves needed updating, which turned out to be the most important part of this PR. CI never tested the version this migration is for.
Both are green, so the package is verified on the old and the new world at once. I also confirmed this locally: 571 tests, Other workflow changes
One thing worth knowing: the first attempt at the format job failed, which was a useful find. I had dropped Not included (happy to do separately if you want them):
All checks green: |
Summary
This PR migrates the package from Flutter’s built-in Material and Cupertino libraries to the standalone
[material_ui](https://pub.dev/packages/material_ui)and[cupertino_ui](https://pub.dev/packages/cupertino_ui)packages.Flutter 3.47 decouples these design libraries from the Flutter SDK. Moving now keeps the package compatible with Flutter’s supported migration path and allows Material/Cupertino updates to be delivered independently of Flutter SDK releases.
Migration commands
Changes
material_uiandcupertino_uias dependencies.package:flutter/material.dartandpackage:flutter/cupertino.dart.constexpressions;createState, whose private return type cannot be mocked.Validation
fvm flutter analyze fvm flutter testBreaking change
Consumers must migrate their own Material and Cupertino imports to the standalone packages when upgrading to this version.
Description
Related Issue: Closes #
Type of Change