Repository navigation
[google_fonts] Migrate to material_ui & cupertino_ui - #13006
Conversation
There was a problem hiding this comment.
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.
| http: ^1.0.0 | ||
| material_ui: ^1.4.0 |
There was a problem hiding this comment.
| dev_dependencies: | ||
| cupertino_ui: ^1.1.1 |
| import 'package:flutter/services.dart'; | ||
| import 'package:http/http.dart' as http; | ||
| import 'package:material_ui/material_ui.dart'; |
There was a problem hiding this comment.
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.
| 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'; |
| path: ../ | ||
| material_ui: ^1.4.0 |
| import 'package:google_fonts/google_fonts.dart'; | ||
| import 'package:material_ui/material_ui.dart'; |
There was a problem hiding this comment.
| ## 9.0.0 | ||
|
|
||
| - Updates minimum supported SDK version to Flutter 3.41/Dart 3.11. | ||
| - Migrates to `material_ui` and `cupertino_ui` packages. |
There was a problem hiding this comment.
nit: Do you think we should mention what users should do in this changelog entry? something like:
| - 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?
There was a problem hiding this comment.
Good question, I think it's alright. Other packages that have migrated have not said so.
…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
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
[shared_preferences]///).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-assistbot 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
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