lerp<T> method Null safety

MaterialStateProperty<T?>? lerp<T>(
  1. MaterialStateProperty<T>? a,
  2. MaterialStateProperty<T>? b,
  3. double t,
  4. T? lerpFunction(
    1. T?,
    2. T?,
    3. double
    )
)

Linearly interpolate between two MaterialStatePropertys.

Implementation

static MaterialStateProperty<T?>? lerp<T>(
  MaterialStateProperty<T>? a,
  MaterialStateProperty<T>? b,
  double t,
  T? Function(T?, T?, double) lerpFunction,
) {
  // Avoid creating a _LerpProperties object for a common case.
  if (a == null && b == null) {
    return null;
  }
  return _LerpProperties<T>(a, b, t, lerpFunction);
}