createRenderer method Null safety

FunnelSeriesRenderer createRenderer(
  1. FunnelSeries<T, D> series
)

Create the pie series renderer.

Implementation

FunnelSeriesRenderer createRenderer(FunnelSeries<T, D> series) {
  FunnelSeriesRenderer? seriesRenderer;
  if (onCreateRenderer != null) {
    seriesRenderer = onCreateRenderer!(series) as FunnelSeriesRenderer;
    // ignore: unnecessary_null_comparison
    assert(seriesRenderer != null,
        'This onCreateRenderer callback function should return value as extends from ChartSeriesRenderer class and should not be return value as null');
    return seriesRenderer;
  }
  return FunnelSeriesRenderer();
}