lerp static method

ExpansionTileThemeData? lerp(
  1. ExpansionTileThemeData? a,
  2. ExpansionTileThemeData? b,
  3. double t
)

Linearly interpolate between ExpansionTileThemeData objects.

Implementation

static ExpansionTileThemeData? lerp(ExpansionTileThemeData? a, ExpansionTileThemeData? b, double t) {
  if (identical(a, b)) {
    return a;
  }
  return ExpansionTileThemeData(
    backgroundColor: Color.lerp(a?.backgroundColor, b?.backgroundColor, t),
    collapsedBackgroundColor: Color.lerp(a?.collapsedBackgroundColor, b?.collapsedBackgroundColor, t),
    tilePadding: EdgeInsetsGeometry.lerp(a?.tilePadding, b?.tilePadding, t),
    expandedAlignment: AlignmentGeometry.lerp(a?.expandedAlignment, b?.expandedAlignment, t),
    childrenPadding: EdgeInsetsGeometry.lerp(a?.childrenPadding, b?.childrenPadding, t),
    iconColor: Color.lerp(a?.iconColor, b?.iconColor, t),
    collapsedIconColor: Color.lerp(a?.collapsedIconColor, b?.collapsedIconColor, t),
    textColor: Color.lerp(a?.textColor, b?.textColor, t),
    collapsedTextColor: Color.lerp(a?.collapsedTextColor, b?.collapsedTextColor, t),
    shape: ShapeBorder.lerp(a?.shape, b?.shape, t),
    collapsedShape: ShapeBorder.lerp(a?.collapsedShape, b?.collapsedShape, t),
    clipBehavior: t < 0.5 ? a?.clipBehavior : b?.clipBehavior,
    expansionAnimationStyle: t < 0.5 ? a?.expansionAnimationStyle : b?.expansionAnimationStyle,
  );
}