xxxxxxxxxx
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: Text('Text Fonts in Flutter'),
),
body: Center(
child: Text(
'Hello World',
style: TextStyle(
fontSize: 20,
fontFamily: 'Roboto', // Replace 'Roboto' with the desired font
fontWeight: FontWeight.bold, // Set font weight if desired
),
),
),
),
);
}
}
xxxxxxxxxx
MaterialApp(
theme: ThemeData(
textTheme: GoogleFonts.montserratTextTheme(
Theme.of(context).textTheme,
),
),
)