lerp static method

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

Linearly interpolates between two styles.

Implementation

static TableStyle? lerp(TableStyle? a, TableStyle? b, double t) {
  if (a == null && b == null) {
    return null;
  }
  if (a == null) {
    return t < 0.5 ? null : b;
  }
  if (b == null) {
    return t < 0.5 ? a : null;
  }
  return TableStyle(
    borderColor: Color.lerp(a.borderColor, b.borderColor, t),
    borderWidth: lerpDouble(a.borderWidth, b.borderWidth, t),
    borderRadius: Radius.lerp(a.borderRadius, b.borderRadius, t),
    cellPadding: EdgeInsetsGeometry.lerp(a.cellPadding, b.cellPadding, t),
    headerBackground: Color.lerp(a.headerBackground, b.headerBackground, t),
    headerTextStyle: TextStyle.lerp(a.headerTextStyle, b.headerTextStyle, t),
    rowStripeColor: Color.lerp(a.rowStripeColor, b.rowStripeColor, t),
  );
}