showBottomPopView<T> function

Future<T?> showBottomPopView<T>(
  1. BuildContext context,
  2. Widget widget, {
  3. bool barrierDismissible = true,
})

Implementation

Future<T?> showBottomPopView<T>(BuildContext context, Widget widget, {bool barrierDismissible = true}) async {
  return await showGeneralDialog<T>(
    context: context,
    barrierDismissible: barrierDismissible,
    barrierLabel: MaterialLocalizations.of(context).modalBarrierDismissLabel,
    barrierColor: Colors.black54,
    transitionDuration: const Duration(milliseconds: 150),
    pageBuilder: (BuildContext context, Animation animation, Animation secondaryAnimation) {
      return Scaffold(
        backgroundColor: Colors.transparent,
        body: Stack(
          children: <Widget>[
            GestureDetector(
              onTap: () {
                if (barrierDismissible) {
                  Navigator.pop(context);
                }
              },
              behavior: HitTestBehavior.opaque,
              child: Container(),
            ),
            Positioned(left: 0, right: 0, bottom: 0, child: widget),
          ],
        ),
      );
    },
  );
}