lerp static method

Linearly interpolates between two dropdown 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 RRulePickerDropdownThemeData? lerp(
  RRulePickerDropdownThemeData? a,
  RRulePickerDropdownThemeData? b,
  double t,
) {
  if (identical(a, b)) {
    return a;
  }

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

  return RRulePickerDropdownThemeData(
    showUnderline: t < 0.5 ? a?.showUnderline : b?.showUnderline,
    style: TextStyle.lerp(a?.style, b?.style, t),
    decoration: BoxDecoration.lerp(a?.decoration, b?.decoration, t),
    menuItemStyle: TextStyle.lerp(a?.menuItemStyle, b?.menuItemStyle, t),
    menuItemDecoration: BoxDecoration.lerp(
      a?.menuItemDecoration,
      b?.menuItemDecoration,
      t,
    ),
  );
}