GradientRotation class

A GradientTransform that rotates the gradient around the center-point of its bounding box.

{@tool snippet}

This sample would rotate a sweep gradient by a quarter turn clockwise:

const SweepGradient gradient = SweepGradient(
  colors: <Color>[Color(0xFFFFFFFF), Color(0xFF009900)],
  transform: GradientRotation(math.pi/4),
);
Inheritance
Annotations
  • @immutable

Constructors

GradientRotation(double radians)
Constructs a GradientRotation for the specified angle. [...]
const

Properties

hashCode int
The hash code for this object. [...]
read-only, inherited
radians double
The angle of rotation in radians in the clockwise direction.
final
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

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
transform(Rect bounds, {TextDirection textDirection}) Matrix4
When a Gradient creates its Shader, it will call this method to determine what transform to apply to the shader for the given Rect and TextDirection. [...]
override

Operators

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