cjmarques
cjmarques

Reputation: 672

How to use available browser fonts in a Flutter web app

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

Answers (1)

Patrick G.
Patrick G.

Reputation: 475

You can use Google font package

https://pub.dev/packages/google_fonts

Upvotes: 1

Related Questions