showUFUDialog function

Future showUFUDialog({
  1. required Widget child(
    1. UFUBottomSheetController controller
    ),
  2. bool allowFullWidth = false,
  3. bool enableInsets = false,
})

Implementation

Future<dynamic> showUFUDialog({
  required Widget Function(UFUBottomSheetController controller) child,
  bool allowFullWidth = false,
  bool enableInsets = false,
}) async {

  // Avoiding dialog and bottom sheet opening in unit testing
  if (RunModeService.isUnitTestMode) return;

  return await Get.dialog(
    UFUPopUpBuilder(
      child: (controller) => Center(
        child: Material(
          color: Colors.transparent,
          child: child.call(controller))),
      allowFullWidth: allowFullWidth,
      enableInsets: enableInsets,
    ),
    transitionDuration: const Duration(milliseconds: UFUtils.transitionDuration),
  );
}