Animate constructor

Animate({
  1. Key? key,
  2. Widget child = const SizedBox.shrink(),
  3. List<Effect>? effects,
  4. AnimateCallback? onInit,
  5. AnimateCallback? onPlay,
  6. AnimateCallback? onComplete,
  7. bool? autoPlay,
  8. Duration? delay,
  9. AnimationController? controller,
  10. Adapter? adapter,
  11. double? value,
  12. double? target,
})

Creates an Animate instance that will manage a list of effects and apply them to the specified child.

Implementation

Animate({
  super.key,
  this.child = const SizedBox.shrink(),
  List<Effect>? effects,
  this.onInit,
  this.onPlay,
  this.onComplete,
  bool? autoPlay,
  Duration? delay,
  this.controller,
  this.adapter,
  this.value,
  this.target,
})  : autoPlay = autoPlay ?? true,
      delay = delay ?? Duration.zero {
  warn(
    autoPlay != false || onPlay == null,
    'Animate.onPlay is not called when Animate.autoPlay=false',
  );
  warn(
    controller == null || onInit == null,
    'Animate.onInit is not called when used with Animate.controller',
  );
  if (this.delay != Duration.zero) {
    String s = "Animate.delay has no effect when used with";
    warn(autoPlay != false, '$s Animate.autoPlay=false');
    warn(adapter == null, '$s Animate.adapter');
    warn(target == null, '$s Animate.target');
    warn(value == null, '$s Animate.value');
  }
  _entries = [];
  if (effects != null) addEffects(effects);
}