Skip to content

[google_fonts] support material ui - #12489

Open
Segatti wants to merge 2 commits into
flutter:mainfrom
Segatti:main
Open

[google_fonts] support material ui#12489
Segatti wants to merge 2 commits into
flutter:mainfrom
Segatti:main

Conversation

@Segatti

@Segatti Segatti commented Aug 17, 2026

Copy link
Copy Markdown

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

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

@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 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.

Comment thread packages/google_fonts/pubspec.yaml Outdated
Comment on lines +13 to +17
cupertino_ui: ^1.0.0
flutter:
sdk: flutter
http: ^1.0.0
material_ui: ^1.0.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

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';

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 from an external package. Use the standard Flutter SDK Material library instead.

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

Comment on lines +5 to +6
import 'package:cupertino_ui/cupertino_ui.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 cupertino_ui or material_ui from external packages. Use the standard Flutter SDK Cupertino and Material libraries instead.

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

@github-actions github-actions Bot added p: google_fonts triage-framework Should be looked at in framework triage labels Aug 17, 2026
@stuartmorgan-g

Copy link
Copy Markdown
Collaborator

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.

@stuartmorgan-g
stuartmorgan-g marked this pull request as draft August 18, 2026 18:41
@stuartmorgan-g
stuartmorgan-g requested a review from Piinks August 18, 2026 18:41
@Segatti
Segatti marked this pull request as ready for review August 18, 2026 22:34

@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 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

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.

critical

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

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.

critical

Adding cupertino_ui as a dependency and replacing the standard package:flutter/cupertino.dart imports is incorrect. The package must use the official Flutter SDK's Cupertino library to maintain compatibility and type safety with standard Flutter applications.

import 'package:flutter/material.dart';
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.

critical

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.

Suggested change
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';

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.

critical

Reverting this import to package:flutter/cupertino.dart is required. The standard Flutter SDK Cupertino library must be used instead of cupertino_ui.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

p: google_fonts triage-framework Should be looked at in framework triage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants