FPopoverController constructor
FPopoverController({
- required TickerProvider vsync,
- bool shown = false,
- FPopoverMotionDelta motion = const FPopoverMotion(),
Creates a FPopoverController with the given vsync, shown and motion.
Implementation
FPopoverController({
required TickerProvider vsync,
bool shown = false,
FPopoverMotionDelta motion = const FPopoverMotion(),
}) {
if (shown) {
_overlay.show();
}
final popoverMotion = motion(const FPopoverMotion());
_animation = AnimationController(
vsync: vsync,
duration: popoverMotion.entranceDuration,
reverseDuration: popoverMotion.exitDuration,
)..value = shown ? 1 : 0;
_curveFade = CurvedAnimation(
parent: _animation,
curve: popoverMotion.fadeInCurve,
reverseCurve: popoverMotion.fadeOutCurve,
);
_curveScale = CurvedAnimation(
parent: _animation,
curve: popoverMotion.expandCurve,
reverseCurve: popoverMotion.collapseCurve,
);
_scale = popoverMotion.scaleTween.animate(_curveScale);
_fade = popoverMotion.fadeTween.animate(_curveFade);
}