ResilientAnimationController.unbounded constructor

ResilientAnimationController.unbounded({
  1. bool broadcast = false,
  2. double value = 0.0,
  3. Duration? duration,
  4. Duration? reverseDuration,
  5. String? debugLabel,
  6. required TickerProvider vsync,
  7. AnimationBehavior animationBehavior = AnimationBehavior.preserve,
})

Creates a resilient animation controller with unbounded limits.

Unbounded controllers have lowerBound set to double.negativeInfinity and upperBound set to double.infinity.

  • broadcast: Whether to broadcast updates to multiple subscribers. Defaults to false.
  • value: The initial value of the animation. Defaults to 0.0.
  • duration: The length of time this animation should last.
  • reverseDuration: The length of time this animation should last when going in reverse.
  • debugLabel: A label used to identify this animation in debug output.
  • vsync: The TickerProvider for driving the animation ticker.
  • animationBehavior: The behavior when animations are disabled by system settings. Defaults to AnimationBehavior.preserve.

Ensures:

  • Initializes in a dormant state (_DormantAnimationControlDelegate) with infinite bounds.

Example:

final controller = ResilientAnimationController.unbounded(
  value: 10.0,
  vsync: vsyncProvider,
);

Implementation

ResilientAnimationController.unbounded({
  this.broadcast = false,
  double value = 0.0,
  Duration? duration,
  Duration? reverseDuration,
  this.debugLabel,
  required this.vsync,
  this.animationBehavior = AnimationBehavior.preserve,
})  : lowerBound = double.negativeInfinity,
      upperBound = double.infinity {
  assert(debugMaybeDispatchCreated('animation', 'AnimationController', this));
  _delegate = _DormantAnimationControlDelegate(
    value: value,
    duration: duration,
    reverseDuration: reverseDuration,
    lowerBound: lowerBound,
    upperBound: upperBound,
    onValueOrDurationChanged: notifyListeners,
  );
}