A 2D gradient.

This is an interface that allows LinearGradient and RadialGradient classes to be used interchangeably in BoxDecorations.

See also:

Implemented by
Annotations
  • @immutable

Constructors

Gradient()
Abstract const constructor. This constructor enables subclasses to provide const constructors so that they can be used in const expressions.
const

Properties

hashCode int
The hash code for this object. [...]
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

createShader(Rect rect, { TextDirection textDirection }) Shader
Creates a Shader for this gradient to fill the given rect. [...]
lerpFrom(Gradient a, double t) Gradient
Linearly interpolates from a to this. [...]
@protected
lerpTo(Gradient b, double t) Gradient
Linearly interpolates from this to b. [...]
@protected
scale(double factor) Gradient
Returns a new gradient with its properties scaled by the given factor. [...]
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() String
Returns a string representation of this object.
inherited

Operators

operator ==(other) bool
The equality operator. [...]
inherited

Static Methods

lerp(Gradient begin, Gradient end, double t) Gradient
Linearly interpolates from begin to end. [...]