Typography


Page Summary


Specifications references

Implementation

ODS library defines its own font style. The font associated to the style is defined in the theme set in the environment.

Apply font style on text

Apply the font style on text like this:

Text("Sample",
	style: Theme.of(context).textTheme.bodyLarge,
),

Apply font style on view

In the example the first text field has a font style set directly.

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        body: Center(
          child: Text(
            'Font applied to a text view',
            style: Theme.of(context).textTheme.bodyLarge,
          ),
        ),
      ),
    );
  }
}