Skip to content

Commit 651c565

Browse files
[google_fonts] Make a map keyed on FontWeight non-const (#10058)
A proposed engine PR will allow construction of arbitrary FontWeight instances and thus needs to overload the FontWeight equality operator (see flutter/flutter#175771) With that change it will no longer be possible to use FontWeight as the key in a const map.
1 parent 117bf63 commit 651c565

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

packages/google_fonts/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 6.3.2
2+
3+
- Makes a map keyed on FontWeight non-const for compatibility with proposed changes to the engine's implementation of FontWeight.
4+
15
## 6.3.1
26

37
- Transfers the package source from

packages/google_fonts/lib/src/google_fonts_variant.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ const String _italic = 'italic';
171171

172172
/// Mapping from font weight types to the 'weight' part of the Google Fonts API
173173
/// specific filename.
174-
const Map<FontWeight, String> _fontWeightToFilenameWeightParts =
174+
final Map<FontWeight, String> _fontWeightToFilenameWeightParts =
175175
<FontWeight, String>{
176176
FontWeight.w100: 'Thin',
177177
FontWeight.w200: 'ExtraLight',

packages/google_fonts/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: google_fonts
22
description: A Flutter package to use fonts from fonts.google.com. Supports HTTP fetching, caching, and asset bundling.
33
repository: https://github.com/flutter/packages/tree/main/packages/google_fonts
44
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+google_fonts%22
5-
version: 6.3.1
5+
version: 6.3.2
66

77
environment:
88
sdk: ^3.7.0

0 commit comments

Comments
 (0)