onInit property

AnimateCallback? onInit
final

Called immediately after the controller is fully initialized, before the Animate.delay or the animation starts playing (see: onPlay). This is not called if an external controller is provided.

For example, this would pause the animation at its halfway point, and save a reference to the controller so it can be started later.

foo.animate(
  autoPlay: false,
  onInit: (controller) {
    controller.value = 0.5;
    _myController = controller;
  }
).slideY()

Implementation

final AnimateCallback? onInit;