rememberAnimationController method

AnimationController rememberAnimationController({
  1. double? value,
  2. Duration? duration,
  3. Duration? reverseDuration,
  4. String? debugLabel,
  5. double lowerBound = 0.0,
  6. double upperBound = 1.0,
  7. AnimationBehavior animationBehavior = AnimationBehavior.normal,
  8. FutureOr<void> onDispose(
    1. AnimationController
    )?,
  9. Object? key,
})

动画控制器

  • 任何参数发生变化就会产生新的

Implementation

AnimationController rememberAnimationController({
  double? value,
  Duration? duration,
  Duration? reverseDuration,
  String? debugLabel,
  double lowerBound = 0.0,
  double upperBound = 1.0,
  AnimationBehavior animationBehavior = AnimationBehavior.normal,
  FutureOr<void> Function(AnimationController)? onDispose,
  Object? key,
}) {
  return remember<AnimationController>(
    factory2: (l) => AnimationController(
      value: value,
      duration: duration,
      reverseDuration: reverseDuration,
      debugLabel: debugLabel,
      lowerBound: lowerBound,
      upperBound: upperBound,
      animationBehavior: animationBehavior,
      vsync: l.tickerProvider,
    ),
    key: FlexibleKey(value, duration, reverseDuration, lowerBound, upperBound,
        animationBehavior, key),
    onDispose: (c) {
      c.dispose();
      onDispose?.call(c);
    },
  );
}