chore: update compatibility with Flutter 3.47.1 - #1353
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
It introduces at least one concrete type-safety bug (math.max(0, double) assigned to double) and also leaves dependency/versioning updates in a state that can cause non-reproducible or inconsistent releases.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR updates fluent_ui for Flutter 3.47.1 by migrating legacy flutter/material.dart and flutter/cupertino.dart usages to the new standalone material_ui and cupertino_ui packages, and adjusts localization delegate wiring to the new structure.
Changes:
- Migrated Material/Cupertino imports (including tests and example) to
material_ui/cupertino_ui. - Updated localization delegate plumbing to rely on
GlobalMaterialLocalizations.delegates. - Minor refactors/cleanups in a few widget/test implementations.
File summaries
| File | Description |
|---|---|
| test/navigation_view_test.dart | Switches test import from flutter/material.dart to material_ui. |
| test/menu_bar_test.dart | Minor test cleanups (const inference, loop variable), aligns with updated APIs. |
| test/app_test.dart | Switches test import from flutter/material.dart to material_ui. |
| pubspec.yaml | Removes flutter_localizations SDK dep; adds material_ui/cupertino_ui. |
| lib/src/fluent_app.dart | Migrates imports and updates delegate yielding to GlobalMaterialLocalizations.delegates. |
| lib/src/controls/surfaces/info_bar.dart | Migrates Icons import to material_ui. |
| lib/src/controls/surfaces/acrylic.dart | Migrates Material import alias from Flutter to material_ui. |
| lib/src/controls/pickers/color_picker/color_picker.dart | Rewrites ternary into if element for list construction (format/style). |
| lib/src/controls/navigation/tab_view/tab_view.dart | Replaces flutter_localizations usage with material_ui delegates; minor if refactors. |
| lib/src/controls/inputs/slider.dart | Migrates Material import alias from Flutter to material_ui. |
| lib/src/controls/form/combo_box.dart | Small numeric expression tweak (but currently introduces a type issue). |
| lib/src/controls/flyouts/tooltip.dart | Removes a null-assertion on typography body style. |
| lib/l10n/generated/fluent_localizations.dart | Switches localization imports and delegates to GlobalMaterialLocalizations.delegates. |
| lib/fluent_ui.dart | Replaces exported Flutter Material symbols with material_ui equivalents; reorders exports. |
| example/pubspec.yaml | Adds material_ui/cupertino_ui deps for the example app. |
| example/lib/widgets/material_equivalents.dart | Migrates imports to material_ui / cupertino_ui. |
| example/lib/widgets/deferred_widget.dart | Migrates flutter/material.dart import to material_ui. |
| CHANGELOG.md | Adds a new 4.17.0 entry describing the migration/compat update. |
Review details
Suppressed comments (1)
lib/src/controls/form/combo_box.dart:408
- Same issue as above:
math.max(0, ...)returnsnum, but the variable is declareddouble. Use0.0so the result is adouble.
final selectedItemOffset = getSelectedItemOffset();
final double maxTopOffset = math.max(0, size.height - scaledItemHeight);
final minBottomOffset = math.min(scaledItemHeight, size.height);
- Files reviewed: 17/18 changed files
- Comments generated: 4
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
Fixed the issues identified by Copilot's code analysis and verified the changes with |
Description
This PR updates the package for Flutter 3.47.1 and migrates the existing Material and Cupertino UI code to the new standalone
material_uiandcupertino_uipackages.Changes
package:flutter/material.darttopackage:material_ui/material_ui.dartpackage:flutter/cupertino.darttopackage:cupertino_ui/cupertino_ui.dartGlobalMaterialLocalizations.delegates, which provides the required Material, Cupertino, and Widgets localization delegates through the new standalone package structureValidation
dart analyze— passedflutter test— 274 tests passedNotes
This is a compatibility and migration update. No intentional changes have been made to the package's existing behavior or functionality.
Pre-launch Checklist
CHANGELOG.mdwith my changes