Skip to content

Instantly share code, notes, and snippets.

@defensive-wizard
Created September 21, 2021 07:00
Show Gist options
  • Save defensive-wizard/135eb983ecd585e78c636de1541b1706 to your computer and use it in GitHub Desktop.
Save defensive-wizard/135eb983ecd585e78c636de1541b1706 to your computer and use it in GitHub Desktop.
Text(
'This is Google Fonts',
style: GoogleFonts.lato(
textStyle: Theme.of(context).textTheme.headline4,
fontSize: 48,
fontWeight: FontWeight.w700,
fontStyle: FontStyle.italic,
),
),
// OR You can directly set a text theme
final textTheme = Theme.of(context).textTheme;
MaterialApp(
theme: ThemeData(
textTheme: GoogleFonts.latoTextTheme(textTheme).copyWith(
body1: GoogleFonts.oswald(textStyle: textTheme.body1),
),
),
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment