map<R> method
Returns a new FWidgetStateMap with the same constraints, but with different values produced by map
.
Where possible, it is strongly recommended to use the CLI to generate a style
and directly modify its FWidgetStateMap
fields instead.
Example
final property = FWidgetStateMap<double>({
WidgetState.pressed: 0.8,
WidgetState.hovered: 0.9,
});
// Convert scale factors to Color opacity values.
final opacityProperty = property.map((scale) => Colors.blue.withOpacity(scale));
Implementation
@useResult
FWidgetStateMap<R> map<R>(R Function(T) map) => FWidgetStateMap<R>({
for (final MapEntry(key: constraint, :value) in _constraints.entries) constraint: map(value),
});