show method

Future<void> show(
  1. BuildContext context,
  2. Widget child,
  3. int speed
)

Implementation

Future<void> show(BuildContext context, Widget child, int speed) async {
  if (_isOpen == false) {
    _hide(context, speed);
    return;
  }
  final overlayState = Overlay.of(context);
  _animationController = AnimationController(
    vsync: overlayState,
    duration: Duration(milliseconds: speed),
  );
  _overlayEntry = OverlayEntry(builder: (context) {
    return AbsorbPointer(
      absorbing: false,
      child: Stack(
        alignment: Alignment.bottomCenter,
        children: [
          SlideUpWidget(
              animationController: _animationController, child: child),
        ],
      ),
    );
  });

  overlayState.insert(_overlayEntry);

  await _animationController.forward();
  _isOpen = false;
}