Skip to content

Migrate to the standalone material_ui / cupertino_ui packages - #2765

Open
putnokiabel wants to merge 1 commit into
singerdmx:masterfrom
putnokiabel:material_ui_migration
Open

Migrate to the standalone material_ui / cupertino_ui packages#2765
putnokiabel wants to merge 1 commit into
singerdmx:masterfrom
putnokiabel:material_ui_migration

Conversation

@putnokiabel

Copy link
Copy Markdown

Description

Migrates the packages off package:flutter/material.dart / package:flutter/cupertino.dart and onto the new standalone material_ui / cupertino_ui packages, following the Flutter breaking change:
https://docs.flutter.dev/release/breaking-changes/material-ui-and-cupertino-ui

How it was done

Following the documented procedure:

dart fix --apply --code=migrate_design_widgets   # rewrite imports
flutter pub add material_ui cupertino_ui         # add the new deps (per package)
dart fix --apply --code=directives_ordering      # re-sort imports

Applied across all packages: flutter_quill, flutter_quill_extensions, flutter_quill_test and example.

Changes

  • 97 Dart files: imports rewritten from package:flutter/material.dartpackage:material_ui/material_ui.dart and package:flutter/cupertino.dartpackage:cupertino_ui/cupertino_ui.dart.
  • Dependencies: added material_ui: ^1.2.0 (all packages) and cupertino_ui: ^1.0.2 (packages that use Cupertino widgets).
  • example/lib/main.dart: hide GlobalMaterialLocalizations on the material_ui import — it now also exports that symbol, which was ambiguous against flutter_localizations.
  • flutter_quill_extensions/pubspec_overrides.yaml: path override so the package builds against the in-repo (migrated) flutter_quill rather than the published release (which still imports package:flutter/material.dart, breaking the ThemeData.isCupertino extension). The override is ignored by consumers and excluded from pub publish, so it only affects local/CI resolution during the transition.

Verification

  • dart analyzeno issues in all four packages (lib + tests).
  • dart format --set-exit-if-changed . — clean.

Note for maintainers

CI (.github/workflows/checks.yml) pins flutter-version: 3.44.1. The material_ui / cupertino_ui packages require a newer Flutter (verified locally on 3.47.2), so the pinned CI version will need bumping alongside this migration.

Apply `dart fix --apply --code=migrate_design_widgets` to move imports from
package:flutter/material.dart and package:flutter/cupertino.dart to the
standalone package:material_ui/material_ui.dart and
package:cupertino_ui/cupertino_ui.dart packages, per the Flutter breaking
change:
https://docs.flutter.dev/release/breaking-changes/material-ui-and-cupertino-ui

- Rewrite imports across flutter_quill, flutter_quill_extensions,
  flutter_quill_test and example (migrate_design_widgets + directives_ordering).
- Add material_ui / cupertino_ui dependencies to each affected package.
- example: hide GlobalMaterialLocalizations from the material_ui import to
  resolve the ambiguity with flutter_localizations.
- flutter_quill_extensions: add pubspec_overrides.yaml so it builds against the
  in-repo (migrated) flutter_quill instead of the published release that still
  imports package:flutter/material.dart. The override is ignored by consumers
  and excluded from `pub publish`.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant