You can also use GoogleFonts.latoTextTheme() to make or modify an entire text theme to use the "Lato" font. TextStyle: Theme.of(context).textTheme.headline4, To override the fontSize, fontWeight, or fontStyle: Text( Style: GoogleFonts.lato(textStyle: Theme.of(context).textTheme.headline4), TextStyle: TextStyle(color: Colors.blue, letterSpacing. To use GoogleFonts with an existing TextStyle: Text( Or, if you want to load the font dynamically: Text( To use GoogleFonts with the default TextStyle: Text( To import GoogleFonts: import 'package:google_fonts/google_fonts.dart' Useful for offline-first apps.įor example, say you want to use the Lato font from Google Fonts in your Flutter app.įirst, add the google_fonts package to your pubspec dependencies. Matching font files found in assets are prioritized over HTTP fetching. Font file caching, on device file system.Can also be used in production to reduce app size HTTP fetching at runtime, ideal for development.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |