nillify static method
Returns an empty, transparent Gradient of type matching type
if
one is available. Otherwise returns null
such that asNill might
generate a "nill" gradient by Gradient.copyWith()
, which itself falls
back to RadialGradient
if type
cannot be matched.
Used as:
final emptyRadialGradient = NillGradients.nillify(RadialGradient);
TODO: Implement GradientCopyWith
Implementation
static Gradient? nillify(Type type) => (type == LinearGradient)
? linear
: (type == RadialGradient)
? radial
: (type == SweepGradient)
? sweep
: (type == LinearSteps)
? stepsLinear
: (type == RadialSteps)
? stepsRadial
: (type == SweepSteps)
? stepsSweep
: null;