showEDrawer function

Future<void> showEDrawer({
  1. required BuildContext context,
  2. String? title,
  3. Widget? content,
  4. bool showClose = true,
  5. double width = 420,
  6. double? height,
  7. EdgeInsets? padding,
  8. String direction = 'rtl',
  9. bool modal = true,
  10. bool lockScroll = true,
  11. bool closeOnClickModal = true,
  12. bool closeOnPressEscape = true,
  13. Widget? customHeader,
  14. Color? backgroundColor,
  15. double? size,
})

Shows a drawer with the given parameters

Implementation

Future<void> showEDrawer({
  required BuildContext context,
  String? title,
  Widget? content,
  bool showClose = true,
  double width = 420,
  double? height,
  EdgeInsets? padding,
  String direction = 'rtl',
  bool modal = true,
  bool lockScroll = true,
  bool closeOnClickModal = true,
  bool closeOnPressEscape = true,
  Widget? customHeader,
  Color? backgroundColor,
  double? size,
}) {
  bool isVisible = true;

  void close() {
    if (isVisible) {
      isVisible = false;
      Navigator.of(context).pop();
    }
  }

  return showDialog(
    context: context,
    barrierColor: Colors.transparent,
    builder: (context) => EDrawer(
      title: title,
      content: content,
      visible: true,
      onClose: close,
      showClose: showClose,
      width: width,
      height: height,
      padding: padding,
      direction: direction,
      modal: modal,
      lockScroll: lockScroll,
      closeOnClickModal: closeOnClickModal,
      closeOnPressEscape: closeOnPressEscape,
      customHeader: customHeader,
      backgroundColor: backgroundColor,
      size: size,
    ),
  );
}