lerp method Null safety

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

Linearly interpolate between two themes.

Implementation

static SfDataGridThemeData? lerp(
    SfDataGridThemeData? a, SfDataGridThemeData? b, double t) {
  if (a == null && b == null) {
    return null;
  }
  return SfDataGridThemeData(
      gridLineColor: Color.lerp(a!.gridLineColor, b!.gridLineColor, t),
      gridLineStrokeWidth:
          lerpDouble(a.gridLineStrokeWidth, b.gridLineStrokeWidth, t),
      selectionColor: Color.lerp(a.selectionColor, b.selectionColor, t),
      currentCellStyle: DataGridCurrentCellStyle.lerp(
          a.currentCellStyle, b.currentCellStyle, t),
      frozenPaneLineColor:
          Color.lerp(a.frozenPaneLineColor, b.frozenPaneLineColor, t),
      frozenPaneLineWidth:
          lerpDouble(a.frozenPaneLineWidth, b.frozenPaneLineWidth, t),
      sortIconColor: Color.lerp(a.sortIconColor, b.sortIconColor, t),
      headerHoverColor: Color.lerp(a.headerHoverColor, b.headerHoverColor, t),
      headerColor: Color.lerp(a.headerColor, b.headerColor, t),
      frozenPaneElevation:
          lerpDouble(a.frozenPaneElevation, b.frozenPaneElevation, t),
      rowHoverColor: Color.lerp(a.rowHoverColor, b.rowHoverColor, t),
      columnResizeIndicatorColor: Color.lerp(
          a.columnResizeIndicatorColor, b.columnResizeIndicatorColor, t),
      columnResizeIndicatorStrokeWidth: lerpDouble(
          a.columnResizeIndicatorStrokeWidth,
          b.columnResizeIndicatorStrokeWidth,
          t),
      rowHoverTextStyle:
          TextStyle.lerp(a.rowHoverTextStyle, b.rowHoverTextStyle, t));
}