Skip to content

Conversation

@stuartmorgan-g
Copy link
Collaborator

@stuartmorgan-g stuartmorgan-g commented Aug 27, 2025

Initial import of google_fonts

As with previous package imports, this is a history graft that will be landed as a merge rather than a squash, to preserve commit history. My changes are all visible as follow-up commits to the initial merge commit, but to summarize:

  • Updated the package metadata (version, changelog, repo links, etc.)
  • Updated the min SDK version to follow our policy
  • Autoformated for the new SDK version
  • Fixed (or in some cases, ignored) violations of our stricter analysis options
  • Adopted the README code excerpts system
  • Adopted the standard repo license format, per repo policy
  • Removed the use of cider to auto-generate changelog updates during generation, to remove the third-party dependency
  • Added a suffix to the generated code, and adds a repo-level rule to ignore that suffix during analysis
  • Added repo-level allowance for protobuf (google-owned) and mustache_template (pinned, with allowance explanation)
  • Removed example/test/unit_test.dart, which failed in CI (it wasn't being run in the source repo's CI) and appeared to be demonstrating an anti-pattern (trying to load fonts via the network in a unit test).
  • Updated example/android/ to use the new build style

Pre-Review Checklist

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 3

guidezpl and others added 30 commits February 1, 2023 12:50
…lutter#366)

Bumps [path_provider](https://github.com/flutter/packages/tree/main/packages/path_provider) from 2.0.12 to 2.0.13.
- [Release notes](https://github.com/flutter/packages/releases)
- [Commits](https://github.com/flutter/packages/commits/path_provider-v2.0.13/packages/path_provider)

---
updated-dependencies:
- dependency-name: path_provider
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [cider](https://github.com/f3ath/cider) from 0.1.3 to 0.1.5.
- [Release notes](https://github.com/f3ath/cider/releases)
- [Changelog](https://github.com/f3ath/cider/blob/master/CHANGELOG.md)
- [Commits](f3ath/cider@0.1.3...0.1.5)

---
updated-dependencies:
- dependency-name: cider
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…lutter#375)

Bumps [path_provider](https://github.com/flutter/packages/tree/main/packages/path_provider) from 2.0.13 to 2.0.14.
- [Release notes](https://github.com/flutter/packages/releases)
- [Commits](https://github.com/flutter/packages/commits/path_provider-v2.0.14/packages/path_provider)

---
updated-dependencies:
- dependency-name: path_provider
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [mockito](https://github.com/dart-lang/mockito) from 5.3.2 to 5.4.0.
- [Release notes](https://github.com/dart-lang/mockito/releases)
- [Changelog](https://github.com/dart-lang/mockito/blob/master/CHANGELOG.md)
- [Commits](dart-lang/mockito@5.3.2...5.4.0)

---
updated-dependencies:
- dependency-name: mockito
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Copy link

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

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 introduces the google_fonts package into the repository. The changes include adding the package source code, an example application, generator scripts, and updating repository-level configuration files like CODEOWNERS, dependabot.yml, and labeler.yml. My review found a couple of issues in the generator script and its documentation that should be addressed. Specifically, the generator uses an insecure HTTP URL to fetch font data, and the generator's README contains outdated information about a removed dependency.


Uri url(int directoryVersion) {
final String paddedVersion = directoryVersion.toString().padLeft(3, '0');
return Uri.parse('http://fonts.gstatic.com/s/f/directory$paddedVersion.pb');

Choose a reason for hiding this comment

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

high

The URL for fetching the font directory protobuf file uses http instead of https. Using an insecure connection can expose the generator to man-in-the-middle attacks. Please update the URL to use https.

Suggested change
return Uri.parse('http://fonts.gstatic.com/s/f/directory$paddedVersion.pb');
return Uri.parse('https://fonts.gstatic.com/s/f/directory$paddedVersion.pb');

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed, as this only affects local development, and seems like a very good change.

Comment on lines 1 to 5
Generates the `GoogleFonts` class, list of supported families, and updates CHANGELOG.md and pubspec.yaml.

1. Navigate to the root directory of this project.
2. `dart pub global activate cider`
3. `dart generator/generator.dart`

Choose a reason for hiding this comment

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

medium

The PR description states that the cider dependency was removed, but this README still instructs users to install and use it. Please update the documentation to reflect the current generator process.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed.

@@ -0,0 +1,8 @@
## Updating the fonts

If you notice fonts that are on [fonts.google.com](https://fonts.google.com) that do not appear in
Copy link
Member

Choose a reason for hiding this comment

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

This file feels somewhat redundant with generator/README.md

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

https://github.com/material-foundation/flutter-packages/blob/main/packages/google_fonts/CONTRIBUTING.md

The goal of the import PR is to import the code as it was. The only reason it has any additional changes is that it has to be updated to follow all the repo conventions that are CI-enforced.

Maintainers are welcome to rewrite the contributor docs and generator README in future PRs, but for now the changes to the docs are just the ones that are the direct result of enforcing repo conventions (e.g., removing references to cider because I removed cider because it's a third-party dependency).

}

// Use cider to update CHANGELOG.md and pubspec.yaml.
Future<void> updateChangelogAndPubspec() async {
Copy link
Member

Choose a reason for hiding this comment

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

can you log output to console to make CHANGELOG updates easier to write?

Copy link
Contributor

Choose a reason for hiding this comment

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

In this repo we write changelog entries as part of the pull request.

Copy link
Member

Choose a reason for hiding this comment

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

I understand. The list of fonts can still be output by the generator to help writing the CHANGELOG update

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Adding new code generator logic is out of scope in this PR. Maintainers can decide how they want to manage CHANGELOG updates and update the script accordingly in follow-ups.

### Visual font swapping
To avoid visual font swaps that occur when a font is loading, use [FutureBuilder](https://api.flutter.dev/flutter/widgets/FutureBuilder-class.html) and [GoogleFonts.pendingFonts()](https://pub.dev/documentation/google_fonts/latest/google_fonts/GoogleFonts/pendingFonts.html).

See the [example app](https://github.com/material-foundation/flutter-packages/blob/main/packages/google_fonts/example/lib/main.dart).
Copy link
Member

Choose a reason for hiding this comment

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

this should still link to source code, no?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It could, but that pub.dev page is the contents of example/lib/main.dart.

@Piinks
Copy link
Contributor

Piinks commented Aug 27, 2025

How can I help @stuartmorgan-g?

Looks like the extra analysis options in the example directory are what the analyzer is unhappy with.
The repo checks are failing on a couple of things, checking in files from the .gitignore, not have gradle configured correctly, and not passing the publishability check.

@guidezpl
Copy link
Member

I'll deal with the 2 missing CLA entries, one from a Google-owned bot, and the other from a Xoogler

@stuartmorgan-g
Copy link
Collaborator Author

Looks like the extra analysis options in the example directory are what the analyzer is unhappy with.
The repo checks are failing on a couple of things, checking in files from the .gitignore, not have gradle configured correctly, and not passing the publishability check.

I just didn't remember to run all of the checks locally, so missed some conformance changes.

@stuartmorgan-g
Copy link
Collaborator Author

I'll deal with the 2 missing CLA entries, one from a Google-owned bot, and the other from a Xoogler

There's no need; I'll override the CLA check once the PR is ready to land. The source repository enforced the same CLA checks, which is a valid override reason.

@esouthren
Copy link
Contributor

Xoogler checking in :) CLA signed.

Copy link
Contributor

@Piinks Piinks left a comment

Choose a reason for hiding this comment

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

LGTM

- Update repo metadata
- Update pubspec.yaml to follow repo conventions
  - Remove cider dependency
- Remove git-ignored files
- Use a suffix for generated files
- Switch to repo analysis options and fix violations
- Standardize licenses
- Update links and docs to match changes
- Reformat CHANGELOG
- Update links
- Adopt readme excerpts
- Update min Flutter SDK version
- Autoformat
- Switch font download links to https
- Update Android exmaple/ Gradle files
- Delete example/unit_test.dart
- Annotate test files that are not web-compatible
- Bump minimum plugin_platform_interface version to satisfy downgrade analysis
@stuartmorgan-g
Copy link
Collaborator Author

Force-pushed to squash all of my incremental adjustment PRs, so they don't all become individual commits in repo history (since this won't be a squash commit).

@stuartmorgan-g stuartmorgan-g merged commit bff47a3 into flutter:main Aug 27, 2025
80 checks passed
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Aug 28, 2025
github-merge-queue bot pushed a commit to flutter/flutter that referenced this pull request Aug 28, 2025
flutter/packages@86fbeec...141d8e3

2025-08-28 [email protected] Roll Flutter from
c65f01d to da5523a (26 revisions) (flutter/packages#9903)
2025-08-28 49699333+dependabot[bot]@users.noreply.github.com
[dependabot]: Bump androidx.test.espresso:espresso-core from 3.6.1 to
3.7.0 in /packages/local_auth/local_auth_android/android
(flutter/packages#9916)
2025-08-28 49699333+dependabot[bot]@users.noreply.github.com
[dependabot]: Bump androidx.test.espresso:espresso-core from 3.6.1 to
3.7.0 in
/packages/google_maps_flutter/google_maps_flutter_android/android
(flutter/packages#9915)
2025-08-28 49699333+dependabot[bot]@users.noreply.github.com
[dependabot]: Bump androidx.test.espresso:espresso-core from 3.6.1 to
3.7.0 in /packages/in_app_purchase/in_app_purchase_android/android
(flutter/packages#9914)
2025-08-27 [email protected] [google_fonts] Initial import
(flutter/packages#9895)
2025-08-27 [email protected]
[camera_android_camerax] Support NV21 (flutter/packages#9853)

If this roll has caused a breakage, revert this CL and stop the roller
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
auto-submit bot pushed a commit that referenced this pull request Sep 4, 2025
Apply feedback from #9895

Note: the `families_diff` file created by the generator should suffice in writing CHANGELOG updates

## Pre-Review Checklist

**Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). 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.

[^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.
mboetger pushed a commit to mboetger/flutter that referenced this pull request Sep 18, 2025
flutter/packages@86fbeec...141d8e3

2025-08-28 [email protected] Roll Flutter from
c65f01d to da5523a (26 revisions) (flutter/packages#9903)
2025-08-28 49699333+dependabot[bot]@users.noreply.github.com
[dependabot]: Bump androidx.test.espresso:espresso-core from 3.6.1 to
3.7.0 in /packages/local_auth/local_auth_android/android
(flutter/packages#9916)
2025-08-28 49699333+dependabot[bot]@users.noreply.github.com
[dependabot]: Bump androidx.test.espresso:espresso-core from 3.6.1 to
3.7.0 in
/packages/google_maps_flutter/google_maps_flutter_android/android
(flutter/packages#9915)
2025-08-28 49699333+dependabot[bot]@users.noreply.github.com
[dependabot]: Bump androidx.test.espresso:espresso-core from 3.6.1 to
3.7.0 in /packages/in_app_purchase/in_app_purchase_android/android
(flutter/packages#9914)
2025-08-27 [email protected] [google_fonts] Initial import
(flutter/packages#9895)
2025-08-27 [email protected]
[camera_android_camerax] Support NV21 (flutter/packages#9853)

If this roll has caused a breakage, revert this CL and stop the roller
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
korca0220 pushed a commit to korca0220/flutter that referenced this pull request Sep 22, 2025
flutter/packages@86fbeec...141d8e3

2025-08-28 [email protected] Roll Flutter from
c65f01d to da5523a (26 revisions) (flutter/packages#9903)
2025-08-28 49699333+dependabot[bot]@users.noreply.github.com
[dependabot]: Bump androidx.test.espresso:espresso-core from 3.6.1 to
3.7.0 in /packages/local_auth/local_auth_android/android
(flutter/packages#9916)
2025-08-28 49699333+dependabot[bot]@users.noreply.github.com
[dependabot]: Bump androidx.test.espresso:espresso-core from 3.6.1 to
3.7.0 in
/packages/google_maps_flutter/google_maps_flutter_android/android
(flutter/packages#9915)
2025-08-28 49699333+dependabot[bot]@users.noreply.github.com
[dependabot]: Bump androidx.test.espresso:espresso-core from 3.6.1 to
3.7.0 in /packages/in_app_purchase/in_app_purchase_android/android
(flutter/packages#9914)
2025-08-27 [email protected] [google_fonts] Initial import
(flutter/packages#9895)
2025-08-27 [email protected]
[camera_android_camerax] Support NV21 (flutter/packages#9853)

If this roll has caused a breakage, revert this CL and stop the roller
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
Jaineel-Mamtora pushed a commit to Jaineel-Mamtora/flutter_forked that referenced this pull request Sep 24, 2025
flutter/packages@86fbeec...141d8e3

2025-08-28 [email protected] Roll Flutter from
c65f01d to da5523a (26 revisions) (flutter/packages#9903)
2025-08-28 49699333+dependabot[bot]@users.noreply.github.com
[dependabot]: Bump androidx.test.espresso:espresso-core from 3.6.1 to
3.7.0 in /packages/local_auth/local_auth_android/android
(flutter/packages#9916)
2025-08-28 49699333+dependabot[bot]@users.noreply.github.com
[dependabot]: Bump androidx.test.espresso:espresso-core from 3.6.1 to
3.7.0 in
/packages/google_maps_flutter/google_maps_flutter_android/android
(flutter/packages#9915)
2025-08-28 49699333+dependabot[bot]@users.noreply.github.com
[dependabot]: Bump androidx.test.espresso:espresso-core from 3.6.1 to
3.7.0 in /packages/in_app_purchase/in_app_purchase_android/android
(flutter/packages#9914)
2025-08-27 [email protected] [google_fonts] Initial import
(flutter/packages#9895)
2025-08-27 [email protected]
[camera_android_camerax] Support NV21 (flutter/packages#9853)

If this roll has caused a breakage, revert this CL and stop the roller
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
danferreira pushed a commit to danferreira/packages that referenced this pull request Oct 22, 2025
Apply feedback from flutter#9895

Note: the `families_diff` file created by the generator should suffice in writing CHANGELOG updates

## Pre-Review Checklist

**Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). 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.

[^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.
lucaantonelli pushed a commit to lucaantonelli/flutter that referenced this pull request Nov 21, 2025
flutter/packages@86fbeec...141d8e3

2025-08-28 [email protected] Roll Flutter from
c65f01d to da5523a (26 revisions) (flutter/packages#9903)
2025-08-28 49699333+dependabot[bot]@users.noreply.github.com
[dependabot]: Bump androidx.test.espresso:espresso-core from 3.6.1 to
3.7.0 in /packages/local_auth/local_auth_android/android
(flutter/packages#9916)
2025-08-28 49699333+dependabot[bot]@users.noreply.github.com
[dependabot]: Bump androidx.test.espresso:espresso-core from 3.6.1 to
3.7.0 in
/packages/google_maps_flutter/google_maps_flutter_android/android
(flutter/packages#9915)
2025-08-28 49699333+dependabot[bot]@users.noreply.github.com
[dependabot]: Bump androidx.test.espresso:espresso-core from 3.6.1 to
3.7.0 in /packages/in_app_purchase/in_app_purchase_android/android
(flutter/packages#9914)
2025-08-27 [email protected] [google_fonts] Initial import
(flutter/packages#9895)
2025-08-27 [email protected]
[camera_android_camerax] Support NV21 (flutter/packages#9853)

If this roll has caused a breakage, revert this CL and stop the roller
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants