Uh oh!
There was an error while loading. Please reload this page.
[google_fonts] support material ui - #12489
Conversation
There was a problem hiding this comment.
Code Review
This pull request replaces standard Flutter SDK imports (package:flutter/material.dart and package:flutter/cupertino.dart) with external third-party packages (package:material_ui/material_ui.dart and package:cupertino_ui/cupertino_ui.dart) and adds them as dependencies in pubspec.yaml. The reviewer flags these changes as critical security and correctness issues, noting that replacing built-in Flutter SDK libraries with external packages introduces supply chain risks and breaks compatibility, and recommends reverting back to the standard Flutter SDK libraries.
| cupertino_ui: ^1.0.0 | ||
| flutter: | ||
| sdk: flutter | ||
| http: ^1.0.0 | ||
| material_ui: ^1.0.0 |
There was a problem hiding this comment.
Replacing the standard Flutter SDK dependencies with external third-party packages like cupertino_ui and material_ui is a critical security and correctness issue. Flutter's Material and Cupertino libraries are built directly into the Flutter SDK. Using external packages instead of the official SDK libraries introduces severe security risks (such as supply chain attacks or typosquatting) and breaks compatibility.
flutter:
sdk: flutterhttp: ^1.0.0| import'package:crypto/crypto.dart'; | ||
| import'package:flutter/foundation.dart'show kIsWeb; | ||
| import'package:flutter/material.dart'; | ||
| import'package:material_ui/material_ui.dart'; |
| import 'package:cupertino_ui/cupertino_ui.dart'; | ||
| import 'package:material_ui/material_ui.dart'; |
There was a problem hiding this comment.
Do not import cupertino_ui or material_ui from external packages. Use the standard Flutter SDK Cupertino and Material libraries instead.
| import'package:cupertino_ui/cupertino_ui.dart'; | |
| import'package:material_ui/material_ui.dart'; | |
| import'package:flutter/cupertino.dart'; | |
| import'package:flutter/material.dart'; |
stuartmorgan-g
commented
Aug 18, 2026
Thanks for the contribution! You haven’t completed all of the items in the PR checklist above, so I’m assuming this is a work in progress and am marking it as a Draft. Please review the checklist, updating the PR as appropriate, and when that’s complete please feel free to mark the PR as ready for review. |
There was a problem hiding this comment.
Code Review
This pull request replaces the standard Flutter SDK imports and dependencies (package:flutter/material.dart and package:flutter/cupertino.dart) with external packages (material_ui and cupertino_ui) across the google_fonts package and its examples. Feedback from the reviewer highlights that these changes introduce critical compatibility issues, as google_fonts must rely on the official Flutter SDK's material and cupertino libraries to ensure type safety and compatibility with standard Flutter applications.
Uh oh!
There was an error while loading. Please reload this page.
| path_provider: ^2.0.0 | ||
| dev_dependencies: | ||
| cupertino_ui: ^1.0.0 |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Segatti
commented
Aug 19, 2026
Hi @Piinks , do you mean the conflict between the Google Fonts versions, or the errors in other libraries (Google Maps, for example) that I didn’t modify? |
Piinks
commented
Aug 19, 2026
The dashboard checks here. They are in the middle of a fresh run right now. |
Segatti
commented
Aug 20, 2026
@Piinks Hi, why are the other checks still pending? |
Piinks
commented
Aug 20, 2026
Because they are waiting for a security check before running. :) |
juampiq6
commented
Aug 24, 2026
Will this new code require for every user to migrate their apps to use and import material ui and cupertino ui? |
Piinks
commented
Aug 24, 2026
@juampiq6 this is still under review. We have already advised that packages migrating to material_ui and/or cupertino_ui should consider it a breaking change. |
| ## 8.2.2 | ||
| - Adds support for the `material_ui` package so `TextStyle` and `TextTheme` types are compatible with Material Design widgets that use `material_ui`. | ||
| - Updates minimum supported SDK version to Flutter 3.44/Dart 3.12. |
There was a problem hiding this comment.
| ## 8.2.2 | |
| -Adds support for the `material_ui` package so `TextStyle` and `TextTheme` types are compatible with Material Design widgets that use `material_ui`. | |
| - Updates minimum supported SDK version to Flutter 3.44/Dart 3.12. | |
| ## 9.0.0 | |
| -Migrates to the `material_ui` package, not backwards compatible with package:flutter/material.dart. | |
| - Updates minimum supported SDK version to Flutter 3.44/Dart 3.12. |
There was a problem hiding this comment.
Actually, instead of 9.0.0, let's mark this "Next". There is another PR out that introduces another breaking change. Rather than release 2 major versions, we'll aim to batch these changes together for one 9.0.0 release.
Let's make this "Next", and in pubspec.yaml, set publish_to: none.
| repository: https://github.com/flutter/packages/tree/main/packages/google_fonts | ||
| issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+google_fonts%22 | ||
| version: 8.2.1 | ||
| version: 8.2.2 |
| ## 8.2.2 | ||
| - Adds support for the `material_ui` package so `TextStyle` and `TextTheme` types are compatible with Material Design widgets that use `material_ui`. | ||
| - Updates minimum supported SDK version to Flutter 3.44/Dart 3.12. |
There was a problem hiding this comment.
Actually, instead of 9.0.0, let's mark this "Next". There is another PR out that introduces another breaking change. Rather than release 2 major versions, we'll aim to batch these changes together for one 9.0.0 release.
Let's make this "Next", and in pubspec.yaml, set publish_to: none.
| import 'dart:ui' as ui; | ||
| import 'package:flutter/material.dart'; | ||
| import 'package:material_ui/material_ui.dart'; |
There was a problem hiding this comment.
Did you run the generator for this? Or was this import updated manually/by dart fix? See comment at the top of the file.
There was a problem hiding this comment.
I used this: dart fix --apply --code=migrate_design_widgets
Added Material UI support to Google Fonts.
List which issues are fixed by this PR. You must list at least one issue.
Fixesflutter/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