getGradient method
Implementation
Gradient? getGradient() {
if (type == FFillType.linearGradient) {
return LinearGradient(
begin: begin ?? Alignment.topCenter,
end: end ?? Alignment.bottomCenter,
colors: levels.map((e) => e.getLevelColor()).toList(),
stops: levels.map((e) => e.stop).toList(),
);
} else if (type == FFillType.radialGradient) {
return RadialGradient(
center: center ?? Alignment.center,
radius: radius ?? 1,
colors: levels.map((e) => e.getLevelColor()).toList(),
stops: levels.map((e) => e.stop).toList(),
);
} else {
return null;
}
}