Loading topic
MaterialApp and Scaffold, and know what a BuildContext is. By the end you will know what ThemeData contains, how it reaches widgets, how to override it for part of the tree, and which mistakes cause surpri5 min readBuildContext is, and how MaterialApp and Scaffold fit together. You should also have seen ThemeData and ColorScheme.fromSeed in the previous chapters. Here the focus is on how widgets read the theme, 6 min readThemeData is passed to MaterialApp, and can use Theme.of(context). It covers what a ColorScheme contains and how to pick the right role for a widget. Generating schemes from a seed color and building the dark scheme come in l5 min readMaterialApp, Scaffold and BuildContext. You should also know that a ColorScheme is a set of named color roles such as primary and onPrimary. Here you will learn how one seed color becomes a wh5 min readColorScheme.fromSeed and the theme and darkTheme parameters on MaterialApp. It covers how to build the dark ColorScheme, what changes between the light and dark versions, and the mistakes that produce a dark th5 min readMaterialApp, Scaffold and BuildContext. It also assumes you have met ThemeData and ColorScheme.fromSeed in earlier chapters. Here you connect two ThemeData objects to MaterialApp and learn how Flutter4 min readText widget in a Material 3 app gets its size, weight and spacing from a small set of named styles. These styles live in TextTheme, and ThemeData holds the TextTheme. This chapter covers the 15 type roles, how to read them, how to override them without breaking dark mode, and how text 5 min readThemeData with ColorScheme.fromSeed, wire theme, darkTheme and themeMode on MaterialApp, and read values with Theme.of(context). The earlier chapters cover those. Here we change how individual widgets such as buttons, app bars, cards and tex5 min readtheme, darkTheme and themeMode arguments of MaterialApp. It also assumes you know how to build a light and a dark ColorScheme from one seed color, and that you are comfortable with ChangeNotifier or ValueNotifier. Here you will add a runtime switch5 min readValueNotifier<ThemeMode>. You should also be comfortable with async/await and BuildContext. The goal is to make the user's choice survive an app restart, without a flash of the wron4 min readColorScheme and TextTheme cover the roles that Material 3 defines. Most apps also need values Material does not define, such as a "success" green, a warning amber, or a spacing scale. This chapter shows how to store those values in the theme with ThemeExtension, so they follow light and dark m5 min readMaterialApp with theme, darkTheme and themeMode, and that you know ColorScheme.fromSeed. It covers how to take colors from the platform, such as the Android 12+ wallpaper palette, and how to fall back safely when the platform has none.4 min readColorScheme.fromSeed, wire theme, darkTheme and themeMode on MaterialApp, and read values with Theme.of(context). It also assumes you have read about ThemeExtension. Here you learn what the Material 3 color system gu6 min read