ColorGradient class abstract

An abstract base class representing a color gradient with multiple color stops.

ColorGradient provides a common interface for working with gradients that can have colors added, modified, or removed at specific positions. This is useful for creating custom gradient pickers and editors.

Implementations should handle the gradient type (linear, radial, sweep, etc.) and provide methods to manipulate color stops and their positions.

Implementers

Constructors

ColorGradient()
Creates a const ColorGradient.
const

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

changeColorAndPositionAt(int index, ColorDerivative color, double position) ColorGradient
Changes both the color and position at the specified index.
changeColorAt(int index, ColorDerivative color) ColorGradient
Changes the color at the specified index.
changePositionAt(int index, double position) ColorGradient
Changes the position of the color stop at the specified index.
copyWith() ColorGradient
Creates a copy of this gradient with optional modifications.
insertColorAt(ColorDerivative color, Offset position, Size size, TextDirection textDirection) → ({ColorGradient gradient, int index})
Inserts a new color stop at a specific position in the gradient.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toGradient() Gradient
Converts this color gradient to a Flutter Gradient.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited