Reputation: 672
I'd like to use fonts that are available in the browser, like all the standard font families. But specifying the font family isn't changing my fonts.
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'flutter web app',
theme: ThemeData(
primarySwatch: Colors.blue,
textTheme: TextTheme(bodyText2: TextStyle(fontFamily: 'Courier New'))
),
home: HomeView(),
);
}
}
How do I use available fonts without having to download and add the fonts to the project?
Upvotes: 1
Views: 485
Reputation: 475
You can use Google font package
https://pub.dev/packages/google_fonts
Upvotes: 1