8. Building Multi-Screen Apps(上)152-164

Untitled

Untitled

Meals App

![Untitled](<https://prod-files-secure.s3.us-west-2.amazonaws.com/9a3e3da7-fd9c-4bbb-977b-6a5da64f14e3/8474d19b-8220-407a-abd7-6ee2fff69359/Untitled.png>)
import 'package:flutter/material.dart';

import 'package:google_fonts/google_fonts.dart';

final theme = ThemeData(
  useMaterial3: true,
  colorScheme: ColorScheme.fromSeed(
    brightness: Brightness.dark,
    seedColor: const Color.fromARGB(255, 131, 57, 0),
  ),
  textTheme: GoogleFonts.latoTextTheme(), //**使用Google fonts預設字體**
);

void main() {
  runApp(const App());
}

class App extends StatelessWidget {
  const App({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      theme: theme,
      home: // Todo ...,
    );
  }
}

google_fonts | Flutter package

 ### Depend on it

Run this command:

With Flutter:
 
 
 $flutter pub add google_fonts

Untitled