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

Available on Gradient, provided by the NillGradients extension

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

Static Properties

linear LinearGradient

Available on Gradient, provided by the NillGradients extension

An empty, transparent LinearGradient.
no setter
radial RadialGradient

Available on Gradient, provided by the NillGradients extension

An empty, transparent RadialGradient.
no setter
stepsLinear LinearSteps

Available on Gradient, provided by the NillGradients extension

An empty, transparent LinearSteps.
no setter
stepsRadial RadialSteps

Available on Gradient, provided by the NillGradients extension

An empty, transparent RadialSteps.
no setter
stepsSweep SweepSteps

Available on Gradient, provided by the NillGradients extension

An empty, transparent SweepSteps.
no setter
sweep SweepGradient

Available on Gradient, provided by the NillGradients extension

An empty, transparent SweepGradient.
no setter

Static Methods

nillify(Type type) Gradient?

Available on Gradient, provided by the NillGradients extension

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.