foregroundColor property
final
The default color for Text and Icons within the app bar.
If null, then AppBarTheme.foregroundColor 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.onPrimary if the overall theme's brightness is Brightness.light, and ColorScheme.onSurface 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.onSurface.
This color is used to configure DefaultTextStyle that contains the toolbar's children, and the default IconTheme widgets that are created if iconTheme and actionsIconTheme are null.
See also:
- backgroundColor, which specifies the app bar's background color.
- 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? foregroundColor;