[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: flutter
http: ^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'; |
|
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.
| flutter: | ||
| sdk: flutter | ||
| http: ^1.0.0 | ||
| material_ui: ^1.0.0 |
There was a problem hiding this comment.
Replacing the standard Flutter SDK dependency with the external material_ui package is a critical issue. google_fonts is a core Flutter package and must rely on the official Flutter SDK's material library to ensure type compatibility (e.g., for TextStyle and TextTheme) with all standard Flutter applications. Please revert this dependency.
| path_provider: ^2.0.0 | ||
|
|
||
| dev_dependencies: | ||
| cupertino_ui: ^1.0.0 |
There was a problem hiding this comment.
| import 'package:flutter/material.dart'; | ||
| 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.
Replacing the standard Flutter SDK import package:flutter/material.dart with package:material_ui/material_ui.dart is a critical error. google_fonts must use the official Flutter SDK's material library to ensure that types like TextStyle and TextTheme are fully compatible with standard Flutter widgets. Please revert this import back to package:flutter/material.dart.
| import 'package:material_ui/material_ui.dart'; | |
| import 'package:flutter/material.dart'; |
| // found in the LICENSE file. | ||
|
|
||
| import 'package:flutter/cupertino.dart'; | ||
| import 'package:cupertino_ui/cupertino_ui.dart'; |
Added Material UI support to Google Fonts.
List which issues are fixed by this PR. You must list at least one issue.
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