Skip to content

Migrate to package:material_ui and package:cupertino_ui #2463

Closed

Description

@rajveermalviya

(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.

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_ui and cupertino_ui to pubspec.yaml, and swap the imports. package:flutter/material.dart appears in 39 files under lib/ and 38 under test/; package:flutter/cupertino.dart in two of each.
    Upstream ships a dart fix for the swap:
    dart fix --apply --code=migrate_design_widgets

  • Our theme layer moves with it: ThemeData and ColorScheme in lib/widgets/theme.dart, and the five ThemeExtension subclasses (DesignVariables, ContentTheme, MessageListTheme, EmojiReactionTheme, ComposeBoxTheme).

  • ZulipLocalizations.localizationsDelegates — which lib/widgets/app.dart and test/widgets/test_app.dart pass to MaterialApp — 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 MaterialUiCompatibilityBridge can't reconcile a package that takes or returns in-SDK Material types in its public API; of our dependencies only video_player, patrol and patrol_finders import package:flutter/material.dart at all, and all three use it only internally, for Colors.

Activity

  1. added 2 commits that reference this issue on Oct 6, 2026
    5b3037e
    d8f7676
  2. added a commit that references this issue on Oct 7, 2026
    6afd2c7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions