WidgetStateColor.fromMap constructor

const WidgetStateColor.fromMap(
  1. WidgetStateMap<Color> map
)

Creates a WidgetStateColor from a WidgetStateMap<Color>.

This constructor's resolve method finds the first MapEntry whose key is satisfied by the set of states, and returns its associated value.

If used as a regular color, the first key that matches an empty Set of WidgetStates will be selected.

To prevent a situation where each WidgetStatesConstraint isn't satisfied by the given set of states, consier adding WidgetState.any as the final WidgetStateMap key.

Implementation

const factory WidgetStateColor.fromMap(WidgetStateMap<Color> map) = _WidgetStateColorMapper;