lerp static method

Linearly interpolates between two labeled switch themes.

The t argument is a value between 0 and 1, where 0 returns the first theme and 1 returns the second theme.

Implementation

static LabeledSwitchThemeData? lerp(
  LabeledSwitchThemeData? a,
  LabeledSwitchThemeData? b,
  double t,
) {
  if (identical(a, b)) {
    return a;
  }

  if (a == null && b == null) {
    return null;
  }

  return LabeledSwitchThemeData(
    style: ButtonStyle.lerp(a?.style, b?.style, t),
    switchTheme: SwitchThemeData.lerp(a?.switchTheme, b?.switchTheme, t),
  );
}