RelativeKeyframe<T> class
A keyframe that animates from the previous keyframe's end value to a target.
This keyframe automatically uses the ending value of the previous keyframe as its starting point, animating to the specified target value.
Type Parameters
T- The type of value to animate.
Overview
Use RelativeKeyframe for smooth transitions between keyframes without explicitly specifying start values. If used as the first keyframe, it acts as a still keyframe.
Example
final timeline = TimelineAnimation<double>(
keyframes: [
AbsoluteKeyframe(Duration(milliseconds: 100), 0.0, 0.5),
RelativeKeyframe(Duration(milliseconds: 100), 1.0), // from 0.5 to 1.0
],
);
- Implemented types
-
- Keyframe<
T>
- Keyframe<
Constructors
- RelativeKeyframe(Duration duration, T target)
-
Creates a relative keyframe that animates to the target value.
const
Properties
Methods
-
compute(
TimelineAnimation< T> timeline, int index, double t) → T -
Computes the value for this keyframe at the given progress.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited