From 2c24c9108a297733ea85938e6ffead840c5d3b79 Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Mon, 22 Sep 2025 18:05:59 -0700 Subject: [PATCH 1/3] [google_fonts] Make a map keyed on FontWeight non-const A proposed engine PR will allow construction of arbitrary FontWeight instances and thus needs to overload the FontWeight equality operator (see https://github.com/flutter/flutter/pull/175771) With that change it will no longer be possible to use FontWeight as the key in a const map. --- packages/google_fonts/CHANGELOG.md | 4 ++++ packages/google_fonts/lib/src/google_fonts_variant.dart | 2 +- packages/google_fonts/pubspec.yaml | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/google_fonts/CHANGELOG.md b/packages/google_fonts/CHANGELOG.md index cc9cff8560a..fe0108bd1c8 100644 --- a/packages/google_fonts/CHANGELOG.md +++ b/packages/google_fonts/CHANGELOG.md @@ -1,3 +1,7 @@ +## 6.3.2 + +- Make a map keyed on FontWeight non-const for compatibility with proposed changes to the engine's implementation of FontWeight. + ## 6.3.1 - Transfers the package source from diff --git a/packages/google_fonts/lib/src/google_fonts_variant.dart b/packages/google_fonts/lib/src/google_fonts_variant.dart index df99f84b670..fb8ab40c229 100644 --- a/packages/google_fonts/lib/src/google_fonts_variant.dart +++ b/packages/google_fonts/lib/src/google_fonts_variant.dart @@ -171,7 +171,7 @@ const String _italic = 'italic'; /// Mapping from font weight types to the 'weight' part of the Google Fonts API /// specific filename. -const Map _fontWeightToFilenameWeightParts = +Map _fontWeightToFilenameWeightParts = { FontWeight.w100: 'Thin', FontWeight.w200: 'ExtraLight', diff --git a/packages/google_fonts/pubspec.yaml b/packages/google_fonts/pubspec.yaml index bbe23465986..3a81ffc7a7c 100644 --- a/packages/google_fonts/pubspec.yaml +++ b/packages/google_fonts/pubspec.yaml @@ -2,7 +2,7 @@ name: google_fonts description: A Flutter package to use fonts from fonts.google.com. Supports HTTP fetching, caching, and asset bundling. 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: 6.3.1 +version: 6.3.2 environment: sdk: ^3.7.0 From be30d86ead223efc3a3201953c8ee33527b675a3 Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Mon, 22 Sep 2025 18:31:17 -0700 Subject: [PATCH 2/3] final declaration --- packages/google_fonts/lib/src/google_fonts_variant.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google_fonts/lib/src/google_fonts_variant.dart b/packages/google_fonts/lib/src/google_fonts_variant.dart index fb8ab40c229..4068d73abc0 100644 --- a/packages/google_fonts/lib/src/google_fonts_variant.dart +++ b/packages/google_fonts/lib/src/google_fonts_variant.dart @@ -171,7 +171,7 @@ const String _italic = 'italic'; /// Mapping from font weight types to the 'weight' part of the Google Fonts API /// specific filename. -Map _fontWeightToFilenameWeightParts = +final Map _fontWeightToFilenameWeightParts = { FontWeight.w100: 'Thin', FontWeight.w200: 'ExtraLight', From 11fd27bef3a6ca56b31d35b1807f55b678be7029 Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Wed, 24 Sep 2025 08:35:50 -0700 Subject: [PATCH 3/3] changelog --- packages/google_fonts/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google_fonts/CHANGELOG.md b/packages/google_fonts/CHANGELOG.md index fe0108bd1c8..b49a261fe0d 100644 --- a/packages/google_fonts/CHANGELOG.md +++ b/packages/google_fonts/CHANGELOG.md @@ -1,6 +1,6 @@ ## 6.3.2 -- Make a map keyed on FontWeight non-const for compatibility with proposed changes to the engine's implementation of FontWeight. +- Makes a map keyed on FontWeight non-const for compatibility with proposed changes to the engine's implementation of FontWeight. ## 6.3.1