copyWith method
- @useResult
- Color? focusColor,
- FVariantsValueDelta<
FSwitchVariantConstraint, FSwitchVariant, Color, Delta> ? trackColor, - FVariantsValueDelta<
FSwitchVariantConstraint, FSwitchVariant, Color, Delta> ? thumbColor, - FLabelStyleDelta? leadingLabelStyle,
- FLabelStyleDelta? trailingLabelStyle,
Returns a copy of this FSwitchStyle with the given properties replaced.
See customizing widget styles.
Parameters
- FSwitchStyle.focusColor - This FSwitch's color when focused.
- FSwitchStyle.trackColor - The track's color.
- FSwitchStyle.thumbColor - The thumb's color.
- FSwitchStyle.leadingLabelStyle - The label style when FSwitch.leadingLabel is true.
- FSwitchStyle.trailingLabelStyle - The label style when FSwitch.leadingLabel is false (the default).
Implementation
@useResult
FSwitchStyle copyWith({
Color? focusColor,
FVariantsValueDelta<FSwitchVariantConstraint, FSwitchVariant, Color, Delta>? trackColor,
FVariantsValueDelta<FSwitchVariantConstraint, FSwitchVariant, Color, Delta>? thumbColor,
FLabelStyleDelta? leadingLabelStyle,
FLabelStyleDelta? trailingLabelStyle,
}) => .new(
focusColor: focusColor ?? this.focusColor,
trackColor: trackColor?.call(this.trackColor) ?? this.trackColor,
thumbColor: thumbColor?.call(this.thumbColor) ?? this.thumbColor,
leadingLabelStyle: leadingLabelStyle?.call(this.leadingLabelStyle) ?? this.leadingLabelStyle,
trailingLabelStyle: trailingLabelStyle?.call(this.trailingLabelStyle) ?? this.trailingLabelStyle,
);