flutter-packages
flutter-packages copied to clipboard
[google_fonts] Enhance font fallback
Description
The main motivation behind this change is to improve the font fallback mechanism. This makes it possible to switch to another font if the current one does not support certain glyphs.
For example, replace all emoticons with an emoji font:
/* ... */
theme: GoogleFonts.latoTextTheme(
GoogleFonts.notoColorEmojiTextTheme(theme.textTheme),
);
/* ... */
With these changes, the app will still use the lato font, but all emoji will be replaced by notoColorEmoji.
Tests
Verifying that the text style correctly falls back to the next available font when the primary font is unavailable.
Checklist
- [x] I've reviewed the contribution guide.
- [x] I've updated the package
CHANGELOG.md