FPopoverController constructor

FPopoverController({
  1. required TickerProvider vsync,
  2. bool shown = false,
})

Creates a FPopoverController with the given vsync and shown.

Implementation

FPopoverController({required TickerProvider vsync, bool shown = false}) : _motion = const FPopoverMotion() {
  if (shown) {
    _overlay.show();
  }

  _animation = AnimationController(
    vsync: vsync,
    value: shown ? 1 : 0,
    duration: _motion.entranceDuration,
    reverseDuration: _motion.exitDuration,
  );
  _curveFade = CurvedAnimation(parent: _animation, curve: _motion.fadeInCurve, reverseCurve: _motion.fadeOutCurve);
  _curveScale = CurvedAnimation(parent: _animation, curve: _motion.expandCurve, reverseCurve: _motion.collapseCurve);
  _scale = _motion.scaleTween.animate(_curveScale);
  _fade = _motion.fadeTween.animate(_curveFade);
}