-
Notifications
You must be signed in to change notification settings - Fork 3.6k
[google_fonts] Initial import #9895
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[google_fonts] Initial import #9895
Conversation
…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>
There was a problem hiding this 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'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
| return Uri.parse('http://fonts.gstatic.com/s/f/directory$paddedVersion.pb'); | |
| return Uri.parse('https://fonts.gstatic.com/s/f/directory$paddedVersion.pb'); |
There was a problem hiding this comment.
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.
| 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` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
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 | |||
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
packages/google_fonts/README.md
Outdated
| ### 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). |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
|
How can I help @stuartmorgan-g? Looks like the extra analysis options in the example directory are what the analyzer is unhappy with. |
|
I'll deal with the 2 missing CLA entries, one from a Google-owned bot, and the other from a Xoogler |
I just didn't remember to run all of the checks locally, so missed some conformance changes. |
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. |
|
Xoogler checking in :) CLA signed. |
Piinks
left a comment
There was a problem hiding this 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
7ac8cc8 to
ffd7a9d
Compare
|
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). |
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
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.
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
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
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
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.
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
Initial import of
google_fontsAs 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:
ciderto auto-generate changelog updates during generation, to remove the third-party dependencyPre-Review Checklist
[shared_preferences]pubspec.yamlwith an appropriate new version according to the pub versioning philosophy, or I have commented below to indicate which version change exemption this PR falls under1.CHANGELOG.mdto add a description of the change, following repository CHANGELOG style, or I have commented below to indicate which CHANGELOG exemption this PR falls under1.///).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 ↩3