lerp static method
Linearly interpolate between two SheetStyle objects.
Implementation
static SheetStyle? lerp(SheetStyle? a, SheetStyle? b, double t) {
if (a == null && b == null) return null;
return SheetStyle(
variant: lerpEnum(a?.variant, b?.variant, t),
severity: lerpEnum(a?.severity, b?.severity, t),
shape: lerpEnum(a?.shape, b?.shape, t),
width: lerpDouble(a?.width, b?.width, t),
height: lerpDouble(a?.height, b?.height, t),
margin: EdgeInsetsGeometry.lerp(a?.margin, b?.margin, t),
padding: EdgeInsetsGeometry.lerp(a?.padding, b?.padding, t),
alignment: lerpEnum(a?.alignment, b?.alignment, t),
clipBehavior: lerpEnum(a?.clipBehavior, b?.clipBehavior, t),
overlayDisabled: lerpBool(a?.overlayDisabled, b?.overlayDisabled, t),
overlayColor: Color.lerp(a?.overlayColor, b?.overlayColor, t),
shadowColor: Color.lerp(a?.shadowColor, b?.shadowColor, t),
surfaceTint: Color.lerp(a?.surfaceTint, b?.surfaceTint, t),
elevation: lerpDouble(a?.elevation, b?.elevation, t),
foregroundStyle:
TextStyle.lerp(a?.foregroundStyle, b?.foregroundStyle, t),
foregroundColor: Color.lerp(a?.foregroundColor, b?.foregroundColor, t),
foregroundOpacity:
lerpDouble(a?.foregroundOpacity, b?.foregroundOpacity, t),
foregroundAlpha: lerpInt(a?.foregroundAlpha, b?.foregroundAlpha, t),
foregroundSpacing:
lerpDouble(a?.foregroundSpacing, b?.foregroundSpacing, t),
foregroundLoosen: lerpBool(a?.foregroundLoosen, b?.foregroundLoosen, t),
foregroundExpanded:
lerpBool(a?.foregroundExpanded, b?.foregroundExpanded, t),
foregroundAlign: lerpEnum(a?.foregroundAlign, b?.foregroundAlign, t),
foregroundJustify:
lerpEnum(a?.foregroundJustify, b?.foregroundJustify, t),
backgroundColor: Color.lerp(a?.backgroundColor, b?.backgroundColor, t),
backgroundOpacity:
lerpDouble(a?.backgroundOpacity, b?.backgroundOpacity, t),
backgroundAlpha: lerpInt(a?.backgroundAlpha, b?.backgroundAlpha, t),
borderColor: Color.lerp(a?.borderColor, b?.backgroundColor, t),
borderOpacity: lerpDouble(a?.borderOpacity, b?.borderOpacity, t),
borderAlpha: lerpInt(a?.borderAlpha, b?.borderAlpha, t),
borderWidth: lerpDouble(a?.borderWidth, b?.borderWidth, t),
borderRadius: BorderRadius.lerp(a?.borderRadius, b?.borderRadius, t),
borderStyle: lerpEnum(a?.borderStyle, b?.borderStyle, t),
iconColor: Color.lerp(a?.iconColor, b?.iconColor, t),
iconOpacity: lerpDouble(a?.iconOpacity, b?.iconOpacity, t),
iconSize: lerpDouble(a?.iconSize, b?.iconSize, t),
);
}