lerp static method
Linearly interpolate between two MenuStyles.
Implementation
static MenuStyle? lerp(MenuStyle? a, MenuStyle? b, double t) {
if (identical(a, b)) {
return a;
}
return MenuStyle(
backgroundColor: WidgetStateProperty.lerp<Color?>(
a?.backgroundColor,
b?.backgroundColor,
t,
Color.lerp,
),
shadowColor: WidgetStateProperty.lerp<Color?>(a?.shadowColor, b?.shadowColor, t, Color.lerp),
surfaceTintColor: WidgetStateProperty.lerp<Color?>(
a?.surfaceTintColor,
b?.surfaceTintColor,
t,
Color.lerp,
),
elevation: WidgetStateProperty.lerp<double?>(a?.elevation, b?.elevation, t, lerpDouble),
padding: WidgetStateProperty.lerp<EdgeInsetsGeometry?>(
a?.padding,
b?.padding,
t,
EdgeInsetsGeometry.lerp,
),
minimumSize: WidgetStateProperty.lerp<Size?>(a?.minimumSize, b?.minimumSize, t, Size.lerp),
fixedSize: WidgetStateProperty.lerp<Size?>(a?.fixedSize, b?.fixedSize, t, Size.lerp),
maximumSize: WidgetStateProperty.lerp<Size?>(a?.maximumSize, b?.maximumSize, t, Size.lerp),
side: WidgetStateBorderSide.lerp(a?.side, b?.side, t),
shape: WidgetStateProperty.lerp<OutlinedBorder?>(a?.shape, b?.shape, t, OutlinedBorder.lerp),
mouseCursor: t < 0.5 ? a?.mouseCursor : b?.mouseCursor,
visualDensity: t < 0.5 ? a?.visualDensity : b?.visualDensity,
alignment: AlignmentGeometry.lerp(a?.alignment, b?.alignment, t),
);
}