main.dart
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
void main() {
runApp(
MaterialApp(
theme: ThemeData(
primarySwatch: Colors.purple,
// dependencies: google_fonts: ^2.2.0
textTheme: GoogleFonts.indieFlowerTextTheme()
),
home: Scaffold(
appBar: AppBar(
title: const Text("Flutter - Google Fonts Text Theme")
),
body: bodyContent()
),
),
);
}
bodyContent(){
return Center(
child: Container(
margin: const EdgeInsets.all(12),
child: const Text(
"Lorem Ipsum is simply dummy text of the printing"
" and typesetting industry. Lorem Ipsum has been the"
" industry's standard dummy text ever since the 1500s,"
" when an unknown printer took a galley of type and"
" scrambled it to make a type specimen book.",
style: TextStyle(fontSize: 26)
)
)
);
}
More flutter tutorials
- flutter – ListTile border
- flutter – ListTile border bottom
- flutter – ListTile border radius
- flutter – ListTile remove padding
- flutter – Space between ListTile leading and title
- flutter – ListTile shape
- flutter – ListTile separator
- flutter – How to use Table
- flutter – Random number in range
- flutter – Random material color
- flutter – Random material color with shade
- flutter – Random bool custom probability
- flutter – How to generate random uuid
- flutter – How to use Google Fonts
- flutter – Function default value