color property

Color? color
final

The color to use when drawing the icon.

Defaults to the current IconTheme color, if any.

The color (whether specified explicitly here or obtained from the IconTheme) will be further adjusted by the opacity of the current IconTheme, if any.

In material apps, if there is a Theme without any IconThemes specified, icon colors default to white if the theme is dark and black if the theme is light.

If no IconTheme and no Theme is specified, icons will default to black.

See Theme to set the current theme and ThemeData.brightness for setting the current theme's brightness.

{@tool snippet} Typically, a Material Design color will be used, as follows:

Icon(
  Icons.widgets,
  color: Colors.blue.shade400,
)

{@end-tool}

Implementation

final Color? color;