TransformGradient typedef
The definition of a Function
that positionally accepts a
double x
then double y
and returns a GradientTransform,
such as the default for this package: TranslateGradient.
In terms of Foil
this callback is registered as Roll.foil
,
and the x
and y
that are provided come from the
AnimationController.value
* Crinkle.scalar
, where
that value
ranges from Crinkle.min
to Crinkle.max
.
GradientTransform
, which this function is expected to return,
is an abstract class with a single method that transforms the
gradient based on bounds and text direction.
Extend that class and override transform()
, returning some Matrix4.
@override Matrix4? transform(Rect bounds, {TextDirection? textDirection});
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.
Implementers may return null from this method, which achieves the same
final effect as returning Matrix4.identity.
Implementation
typedef TransformGradient = GradientTransform Function(double x, double y);