lerp method Null safety

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

Linearly interpolate between two themes.

The arguments must not be null.

Implementation

static SfMapsThemeData? lerp(
    SfMapsThemeData? a, SfMapsThemeData? b, double t) {
  if (a == null && b == null) {
    return null;
  }
  return SfMapsThemeData(
    layerColor: Color.lerp(a!.layerColor, b!.layerColor, t),
    layerStrokeColor: Color.lerp(a.layerStrokeColor, b.layerStrokeColor, t),
    layerStrokeWidth: lerpDouble(a.layerStrokeWidth, b.layerStrokeWidth, t),
    shapeHoverColor: Color.lerp(a.shapeHoverColor, b.shapeHoverColor, t),
    shapeHoverStrokeColor:
        Color.lerp(a.shapeHoverStrokeColor, b.shapeHoverStrokeColor, t),
    shapeHoverStrokeWidth:
        lerpDouble(a.shapeHoverStrokeWidth, b.shapeHoverStrokeWidth, t),
    legendTextStyle: TextStyle.lerp(a.legendTextStyle, b.legendTextStyle, t),
    markerIconColor: Color.lerp(a.markerIconColor, b.markerIconColor, t),
    markerIconStrokeColor:
        Color.lerp(a.markerIconStrokeColor, b.markerIconStrokeColor, t),
    markerIconStrokeWidth:
        lerpDouble(a.markerIconStrokeWidth, b.markerIconStrokeWidth, t),
    dataLabelTextStyle:
        TextStyle.lerp(a.dataLabelTextStyle, b.dataLabelTextStyle, t),
    bubbleColor: Color.lerp(a.bubbleColor, b.bubbleColor, t),
    bubbleStrokeColor:
        Color.lerp(a.bubbleStrokeColor, b.bubbleStrokeColor, t),
    bubbleStrokeWidth:
        lerpDouble(a.bubbleStrokeWidth, b.bubbleStrokeWidth, t),
    bubbleHoverColor: Color.lerp(a.bubbleHoverColor, b.bubbleHoverColor, t),
    bubbleHoverStrokeColor:
        Color.lerp(a.bubbleHoverStrokeColor, b.bubbleHoverStrokeColor, t),
    bubbleHoverStrokeWidth:
        lerpDouble(a.bubbleHoverStrokeWidth, b.bubbleHoverStrokeWidth, t),
    selectionColor: Color.lerp(a.selectionColor, b.selectionColor, t),
    selectionStrokeColor:
        Color.lerp(a.selectionStrokeColor, b.selectionStrokeColor, t),
    selectionStrokeWidth:
        lerpDouble(a.selectionStrokeWidth, b.selectionStrokeWidth, t),
    tooltipColor: Color.lerp(a.tooltipColor, b.tooltipColor, t),
    tooltipStrokeColor:
        Color.lerp(a.tooltipStrokeColor, b.tooltipStrokeColor, t),
    tooltipStrokeWidth:
        lerpDouble(a.tooltipStrokeWidth, b.tooltipStrokeWidth, t),
    tooltipBorderRadius: BorderRadiusGeometry.lerp(
        a.tooltipBorderRadius, b.tooltipBorderRadius, t),
    toggledItemColor: Color.lerp(a.toggledItemColor, b.toggledItemColor, t),
    toggledItemStrokeColor:
        Color.lerp(a.toggledItemStrokeColor, b.toggledItemStrokeColor, t),
    toggledItemStrokeWidth:
        lerpDouble(a.toggledItemStrokeWidth, b.toggledItemStrokeWidth, t),
  );
}