View on GitHub

reads

https://yazansneneh.github.io/reads/

Section 12: BMI Calculator - Building Flutter UIs for Intermediates

Use themes to share colors and font styles

Creating an app theme

MaterialApp(
  title: appName,
  theme: ThemeData(
    // Define the default brightness and colors.
    brightness: Brightness.dark,
    primaryColor: Colors.lightBlue[800],

    // Define the default font family.
    fontFamily: 'Georgia',

    // Define the default `TextTheme`. Use this to specify the default
    textTheme: TextTheme(
      // define the body text style
       bodyText2: TextStyle(fontSize: 14.0, fontFamily: 'Hind'),
      // define the title style
      headline1: TextStyle(fontSize: 72.0, fontWeight: FontWeight.bold),
    )
  )
)

ThemeData class

Constructors
Properties
Methods:

Color class

Constructor

Final and Const

final name = 'Bob'; // Without a type annotation
final String nickname = 'Bobby';

const bar = 1000000; // Unit of pressure (dynes/cm2)
const double atm = 1.01325 * bar; // Standard atmosphere

Font Awesome Flutter Package

Installation
Usage:
  1. import it:
  2. use it:
    • example: ```dart import ‘package:font_awesome_flutter/font_awesome_flutter.dart’;

IconButton( // Use the FaIcon Widget + FontAwesomeIcons class for the IconData icon: FaIcon(FontAwesomeIcons.gamepad), onPressed: () { print(“Pressed”); } ), ```

Icon names