lerp method Null safety

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) {
  assert (t != null);
  if (a == null && b == null) {
    return null;
  }
  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),
  );
}