foregroundColor property

Color? foregroundColor
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:

Implementation

final Color? foregroundColor;