Repository navigation
Description
(I drafted this issue with Claude Code, in a local session using Opus 5.)
Flutter has moved the Material and Cupertino libraries out of the SDK into standalone packages, package:material_ui and package:cupertino_ui.
Contributions to the in-SDK libraries were frozen in 3.44, the standalone packages reached 1.0 in 3.47, and the in-SDK libraries are scheduled for formal deprecation in the November stable release.
- https://docs.flutter.dev/release/breaking-changes/material-ui-and-cupertino-ui
- https://flutter.dev/blog/whats-new-in-flutter-3-47
- [material_ui, cupertino_ui] Deprecate Material and Cupertino flutter/flutter#191230
The first piece has already reached us: flutter_localizations' Material and Cupertino halves are deprecated on main, which broke tools/check analyze. We suppressed those warnings in #2464. This issue is to do the migration, and drop that suppression.
Nothing is scheduled for removal, so there's no deadline. But we follow the tip of Flutter's main branch, so more of these will arrive as the rest of the in-SDK libraries get annotated.
What this involves
-
Add
material_uiandcupertino_uitopubspec.yaml, and swap the imports.package:flutter/material.dartappears in 39 files underlib/and 38 undertest/;package:flutter/cupertino.dartin two of each.
Upstream ships adart fixfor the swap:
dart fix --apply --code=migrate_design_widgets -
Our theme layer moves with it:
ThemeDataandColorSchemeinlib/widgets/theme.dart, and the fiveThemeExtensionsubclasses (DesignVariables,ContentTheme,MessageListTheme,EmojiReactionTheme,ComposeBoxTheme). -
ZulipLocalizations.localizationsDelegates— whichlib/widgets/app.dartandtest/widgets/test_app.dartpass toMaterialApp— is generated, and gen-l10n doesn't know about the standalone packages yet. Until that's fixed upstream we'd write the delegate list ourselves. -
Our dependencies shouldn't get in the way. The migration guide's
MaterialUiCompatibilityBridgecan't reconcile a package that takes or returns in-SDK Material types in its public API; of our dependencies onlyvideo_player,patrolandpatrol_findersimportpackage:flutter/material.dartat all, and all three use it only internally, forColors.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
l10n [nfc]: Suppress new deprecation warnings from flutter_localizations
l10n [nfc]: Suppress new deprecation warnings from flutter_localizations
l10n [nfc]: Suppress new deprecation warnings from flutter_localizations
deps: Migrate to `package:material_ui` and `package:cupertino_ui`
deps: Migrate to `package:material_ui` and `package:cupertino_ui`
deps: Migrate to `package:material_ui` and `package:cupertino_ui`