27
loading...
This website collects cookies to deliver better user experience
pub spec.yml
dependencies.dependencies:
flutter:
sdk: flutter
#Load the Google fonts package
google_fonts: ^2.1.0
lib/main.dart
file and place the following import there.import 'package:google_fonts/google_fonts.dart';
Text(
'Hello World 👋',
textDirection: TextDirection.ltr,
style: GoogleFonts.pacifico(fontSize: 48),
)
appBar: AppBar(
title: Text(
'Testing Google Fonts',
style: GoogleFonts.pacifico(),
),
),
MaterialApp(
theme: ThemeData(
textTheme: GoogleFonts.pacificoTextTheme(),
),
)
Text(
'Hello World 👋',
textDirection: TextDirection.ltr,
),
Note: the AppBar is not changed here as the theme font won't change that by default!