contrastColor property
Color
get
contrastColor
A pure Color contrasting with this one (i.e., Colors.black or Colors.white), depending on the estimatedBrightness.
Implementation
Color get contrastColor => estimatedBrightness.contrastColor;