ThenEffect class

A special convenience "effect" that makes it easier to sequence effects after one another. It does this by calculating a new inheritable delay by adding the previous effect's delay, duration and its own optional delay.

For example, this would cause the scale to run 300 milliseconds after the fade completes:

Text("Hello").animate()
  .fadeIn(delay: 300.ms, duration: 500.ms)
  .then() // sets own delay to 800ms (300+500)
  .slide(duration: 400.ms) // inherits the 800ms delay
  .then(delay: 200.ms) // sets delay to 1400ms (800+400+200)
  .blur() // inherits the 1400ms delay
  // Explicitly setting delay overrides the inherited value.
  // This move effect will run BEFORE the initial fade:
  .move(delay: 0.ms)

This makes it easy to change the delay or duration of the fadeIn, without having to update the delay on scale to match.

Note that this simply calculates a new delay that will be inherited by the subsequent effect. In the example above, it is functionally equivalent to setting delay: 1400.ms on the blur effect.

Inheritance
Annotations

Constructors

ThenEffect({Duration? delay, Duration? duration, Curve? curve})
const

Properties

begin → double?
The begin value for the effect. If null, effects should use a reasonable default value when appropriate.
finalinherited
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.
finalinherited
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.
finalinherited
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.
finalinherited
end → double?
The end value for the effect. If null, effects should use a reasonable default value when appropriate.
finalinherited
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.
override
buildAnimation(AnimationController controller, EffectEntry entry) → Animation<double>
Returns an animation based on the controller, entry, and begin/end values.
inherited
getBeginRatio(AnimationController controller, EffectEntry entry) → double
Returns a ratio corresponding to the beginning of the specified entry.
inherited
getEndRatio(AnimationController controller, EffectEntry entry) → double
Returns a ratio corresponding to the end of the specified entry.
inherited
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.
inherited
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.
inherited
isAnimationActive(Animation animation) → bool
Check if the animation is currently running / active.
inherited
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