Flutter Tutorials

Flutter app development tutorials


flutter – Google fonts text theme

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



About Me

Flutter Developer

Design a site like this with WordPress.com
Get started