howtodothisinflutter
howtodothisinflutter copied to clipboard
Custom fonts
Add the font files to your assets directory let's say
assets/fonts/NexaLight.ttf
Import the font in pubspec.yaml
flutter:
fonts:
- family: NexaLight
fonts:
- asset: fonts/NexaLight.ttf
- asset: fonts/NexaLight-Bold.ttf
weight: 700
Use it in your flutter application
Text(
'Nexa Light sample',
style: TextStyle(fontFamily: 'NexaLight'),
);