NillGradients extension

A wrapper for retrieving transparent, empty Gradients appropriate for smooth GradientTweens.

Though all are transparent, consider that some have other properties set as well; such as the start and end angle for sweep both being ~0 or the radius of radial being 0.

The getter asNill is an extended property for an instantiated Gradient. It refers to the static method nillify, which may be called as:

NillGradients.nillify(Type type)
on

Properties

asNill Gradient
Gradient get asNill => nillify( /* this. */ runtimeType);
no setter

Static Properties

linear LinearGradient
An empty, transparent LinearGradient.
no setter
radial RadialGradient
An empty, transparent RadialGradient.
no setter
stepsLinear LinearSteps
An empty, transparent LinearSteps.
no setter
stepsRadial RadialSteps
An empty, transparent RadialSteps.
no setter
stepsSweep SweepSteps
An empty, transparent SweepSteps.
no setter
sweep SweepGradient
An empty, transparent SweepGradient.
no setter

Static Methods

nillify(Type type) Gradient?
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.