Skip to content

[google_fonts] Migrate to material_ui & cupertino_ui - #13006

Merged
auto-submit[bot] merged 2 commits into
flutter:mainfrom
Piinks:migrate_fonts
Sep 28, 2026
Merged

auto-submit[bot] merged 2 commits into
flutter:mainfrom
Piinks:migrate_fonts

Conversation

@Piinks

@Piinks Piinks commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

We have batched together for this major release some other breaking changes of removing some fonts as well as the migration to material_ui and cupertino_ui

Fixes flutter/flutter#191067

Pre-Review Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the gemini-code-assist bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.

Footnotes

  1. Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. ↩ ↩2

@flutter-dashboard flutter-dashboard Bot added the CICD Run CI/CD label Sep 24, 2026
@github-actions github-actions Bot added p: google_fonts triage-design Should be looked at in design triage labels Sep 24, 2026
@Piinks Piinks mentioned this pull request Sep 24, 2026
11 tasks done

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request migrates the google_fonts package and its example application from the official Flutter SDK (package:flutter/material.dart and package:flutter/cupertino.dart) to the third-party packages material_ui and cupertino_ui, alongside updating the minimum supported SDK versions. Feedback from the reviewer raises critical security concerns regarding supply chain risks, advising that the package and its examples must continue to rely on the official Flutter SDK rather than third-party alternatives.

Comment on lines 15 to +16
http: ^1.0.0
material_ui: ^1.4.0

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

security-critical critical

Do not add material_ui as a dependency. Core Flutter packages must rely on the official Flutter SDK (package:flutter/material.dart) rather than third-party packages. This introduces unnecessary supply chain risks and potential security vulnerabilities.

  http: ^1.0.0

Comment on lines 20 to +21
dev_dependencies:
cupertino_ui: ^1.1.1

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

security-critical critical

Do not add cupertino_ui as a dev dependency. Use the official Flutter SDK's package:flutter/cupertino.dart instead.

dev_dependencies:

Comment on lines 7 to +9
import 'package:flutter/services.dart';
import 'package:http/http.dart' as http;
import 'package:material_ui/material_ui.dart';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

security-critical critical

Do not import material_ui. The official Flutter SDK's package:flutter/material.dart must be used instead. Replacing core SDK imports with third-party packages introduces severe security risks (such as supply chain attacks) and breaks standard Flutter integration.

Suggested change
import 'package:flutter/services.dart';
import 'package:http/http.dart' as http;
import 'package:material_ui/material_ui.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:http/http.dart' as http;

// found in the LICENSE file.

import 'package:flutter/cupertino.dart';
import 'package:cupertino_ui/cupertino_ui.dart';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

security-critical critical

Do not import cupertino_ui. Use the official Flutter SDK's package:flutter/cupertino.dart instead.

Suggested change
import 'package:cupertino_ui/cupertino_ui.dart';
import 'package:flutter/cupertino.dart';

Comment on lines 14 to +15
path: ../
material_ui: ^1.4.0

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

security-critical critical

Do not add material_ui as a dependency in the example app. Use the official Flutter SDK instead.

    path: ../

Comment on lines 7 to +8
import 'package:google_fonts/google_fonts.dart';
import 'package:material_ui/material_ui.dart';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

security-critical critical

Do not import material_ui. Use the official Flutter SDK's package:flutter/material.dart instead.

Suggested change
import 'package:google_fonts/google_fonts.dart';
import 'package:material_ui/material_ui.dart';
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';

@QuncCccccc QuncCccccc left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

## 9.0.0

- Updates minimum supported SDK version to Flutter 3.41/Dart 3.11.
- Migrates to `material_ui` and `cupertino_ui` packages.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Do you think we should mention what users should do in this changelog entry? something like:

Suggested change
- Migrates to `material_ui` and `cupertino_ui` packages.
- Migrates the `TextTheme` APIs to `material_ui`.
Applications using these APIs must migrate to `material_ui` before
upgrading. See the Material and Cupertino UI migration guide.

Seems cupertino_ui exists in test/ only, so maybe no need to mention it?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question, I think it's alright. Other packages that have migrated have not said so.

@Piinks Piinks added the autosubmit Merge PR when tree becomes green via auto submit App label Sep 28, 2026
@auto-submit
auto-submit Bot merged commit c048cd3 into flutter:main Sep 28, 2026
13 checks passed
pull Bot pushed a commit to g-star1024/flutter that referenced this pull request Sep 29, 2026
…er#193507)

flutter/packages@ba0364a...3c6ce59

2026-09-29 [email protected] [cupertino_icons] Migrate to
`cupertino_ui` (flutter/packages#12649)
2026-09-29 [email protected] Manual roll Flutter from
4fcd90b to c5a061b (222 revisions) (flutter/packages#13060)
2026-09-28 [email protected] Enable Built-in Kotlin in all Flutter
Android Plugin Example Apps (flutter/packages#12883)
2026-09-28 [email protected] Enable Built-in Kotlin for
`interactive_media_ads` (flutter/packages#12912)
2026-09-28 [email protected] [google_maps_flutter] Adopt Pigeon's
Kotlin 'suspend' support (flutter/packages#12980)
2026-09-28 [email protected] [material_ui] Fix floating-point
rounding errors for discrete Slider and RangeSlider
(flutter/packages#13022)
2026-09-28 [email protected] [google_sign_in] PR 4/4 Convert
the Pigeon host API from Objective-C to Swift (flutter/packages#12658)
2026-09-28 [email protected]
[google_maps_flutter] Disable flaky web tests blocking latest flutter ->
packages roll (flutter/packages#13047)
2026-09-28 [email protected] [material_ui] Add fontFeatures and
fontVariations to TextTheme.apply() (flutter/packages#12879)
2026-09-28 [email protected]
[in_app_purchase_storekit] Disable flaky tests blocking latest flutter
-> packages roll (flutter/packages#13048)
2026-09-28 [email protected] Sync release-material_ui-1.5.0 to
main (flutter/packages#13051)
2026-09-28 [email protected] Sync release-go_router-18.0.2 to
main (flutter/packages#13050)
2026-09-28 [email protected] [google_fonts] Migrate to material_ui &
cupertino_ui (flutter/packages#13006)
2026-09-28 [email protected] [go_router_builder] Reland material_ui
migration (flutter/packages#12995)

If this roll has caused a breakage, revert this CL and set the roller
to dry run mode using the controls here:
https://autoroll.skia.org/r/flutter-packages-flutter-autoroll
Please CC [email protected] on the revert to ensure that a
human
is aware of the problem.

To file a bug in Flutter:
https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmit Merge PR when tree becomes green via auto submit App CICD Run CI/CD p: google_fonts triage-design Should be looked at in design triage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

material_ui TextTheme conflict after Flutter/package update - previously working [google_fonts]

2 participants