Effect<T> class

Class that defines the required interface and helper methods for all effect classes. Look at the various effects for examples of how to build new reusable effects. One-off effects can be implemented with CustomEffect.

It can be instantiated and added to Animate, but has no visual effect.

Implementers
Annotations

Constructors

Effect({Duration? delay, Duration? duration, Curve? curve, T? begin, T? end})
const

Properties

begin → T?
The begin value for the effect. If null, effects should use a reasonable default value when appropriate.
final
curve → Curve?
The specified curve for the effect. If null, will use the curve from the previous effect, or Animate.defaultCurve if this is the first effect.
final
delay → Duration?
The specified delay for the effect. If null, will use the delay from the previous effect, or Duration.zero if this is the first effect.
final
duration → Duration?
The specified duration for the effect. If null, will use the duration from the previous effect, or Animate.defaultDuration if this is the first effect.
final
end → T?
The end value for the effect. If null, effects should use a reasonable default value when appropriate.
final
hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

build(BuildContext context, Widget child, AnimationController controller, EffectEntry entry) → Widget
Builds the widgets necessary to implement the effect, based on the provided AnimationController and EffectEntry.
buildAnimation(AnimationController controller, EffectEntry entry) → Animation<T>
Returns an animation based on the controller, entry, and begin/end values.
getBeginRatio(AnimationController controller, EffectEntry entry) → double
Returns a ratio corresponding to the beginning of the specified entry.
getEndRatio(AnimationController controller, EffectEntry entry) → double
Returns a ratio corresponding to the end of the specified entry.
getOptimizedBuilder<U>({required ValueListenable<U> animation, Widget? child, required TransitionBuilder builder}) → AnimatedBuilder
Returns an optimized AnimatedBuilder that doesn't rebuild if the value hasn't changed.
getToggleBuilder({required ValueListenable<double> animation, required Widget child, required bool toggle(), required ToggleEffectBuilder builder}) → AnimatedBuilder
Returns an AnimatedBuilder that rebuilds when the boolean value returned by the toggle function changes.
isAnimationActive(Animation animation) → bool
Check if the animation is currently running / active.
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