lerp method

  1. @useResult
FSwitchStyle lerp(
  1. FSwitchStyle other,
  2. double t
)

Linearly interpolate between this and another FSwitchStyle using the given factor t.

Implementation

@useResult
FSwitchStyle lerp(FSwitchStyle other, double t) => FSwitchStyle(
  focusColor: Color.lerp(focusColor, other.focusColor, t) ?? focusColor,
  trackColor: FWidgetStateMap.lerpColor(trackColor, other.trackColor, t),
  thumbColor: FWidgetStateMap.lerpColor(thumbColor, other.thumbColor, t),
  labelPadding: EdgeInsetsGeometry.lerp(labelPadding, other.labelPadding, t) ?? labelPadding,
  descriptionPadding: EdgeInsetsGeometry.lerp(descriptionPadding, other.descriptionPadding, t) ?? descriptionPadding,
  errorPadding: EdgeInsetsGeometry.lerp(errorPadding, other.errorPadding, t) ?? errorPadding,
  childPadding: EdgeInsetsGeometry.lerp(childPadding, other.childPadding, t) ?? childPadding,
  labelTextStyle: FWidgetStateMap.lerpTextStyle(labelTextStyle, other.labelTextStyle, t),
  descriptionTextStyle: FWidgetStateMap.lerpTextStyle(descriptionTextStyle, other.descriptionTextStyle, t),
  errorTextStyle: TextStyle.lerp(errorTextStyle, other.errorTextStyle, t) ?? errorTextStyle,
);