gradient property Null safety

Gradient? gradient
final

A gradient to use when filling the range pointer.

gradient of RangePointer only support SweepGradient and specified SweepGradient.stops are applied within the pointer value.

Defaults to null.

Widget build(BuildContext context) {
   return Container(
       child: SfRadialGauge(
         axes:<RadialAxis>[RadialAxis(
            pointers: <GaugePointer>[RangePointer(value: 20,
             gradient:SweepGradient(
            colors: const <Color>[Colors.red, Color(0xFFFFDD00),
            Color(0xFFFFDD00), Color(0xFF30B32D),],
            stops: const <double>[0, 0.2722222, 0.5833333, 0.777777,],
          ))],
           )]
       ));
}

Implementation

final Gradient? gradient;