backgroundColor property
final
The fill color to use for an app bar's Material.
If null, then the AppBarTheme.backgroundColor is used. If that value is also null: In Material v2 (i.e., when ThemeData.useMaterial3 is false), then AppBar uses the overall theme's ColorScheme.primary if the overall theme's brightness is Brightness.light, and ColorScheme.surface if the overall theme's brightness is Brightness.dark. In Material v3 (i.e., when ThemeData.useMaterial3 is true), then AppBar uses the overall theme's ColorScheme.surface
If this color is a MaterialStateColor it will be resolved against MaterialState.scrolledUnder when the content of the app's primary scrollable overlaps the app bar.
See also:
- foregroundColor, which specifies the color for icons and text within the app bar.
- Theme.of, which returns the current overall Material theme as a ThemeData.
- ThemeData.colorScheme, the thirteen colors that most Material widget default colors are based on.
- ColorScheme.brightness, which indicates if the overall Theme is light or dark.
Implementation
final Color? backgroundColor;