ShowUFUBottomSheet function

Future ShowUFUBottomSheet({
  1. required Widget child(
    1. UFUBottomSheetController controller
    ),
  2. bool isScrollControlled = false,
  3. bool ignoreSafeArea = true,
  4. bool isDismissible = true,
  5. bool enableDrag = false,
  6. bool allowFullWidth = false,
  7. bool enableInsets = false,
})

showUFUBottomSheet can be used when we have to perform loading but we don't have controller for managing our loading state a default controller will be provided with it and loading state can be toggled easily by controller.toggleIsLoading()

Implementation

Future<dynamic> ShowUFUBottomSheet({
  required Widget Function(UFUBottomSheetController controller) child,
  bool isScrollControlled = false,
  bool ignoreSafeArea = true,
  bool isDismissible = true,
  bool enableDrag = false,
  bool allowFullWidth = false,
  bool enableInsets = false}) async {

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

  if (!UFUScreen.isMobile) {
    return await showUFUDialog(
        child: child,
        allowFullWidth: allowFullWidth,
        enableInsets: enableInsets);
  } else {
    return await Get.bottomSheet(
      UFUPopUpBuilder(
        child: child,
      ),

      isScrollControlled: isScrollControlled,
      ignoreSafeArea: ignoreSafeArea,
      isDismissible: isDismissible,
      enableDrag: enableDrag,
      enterBottomSheetDuration: const Duration(milliseconds: UFUtils.transitionDuration),
      exitBottomSheetDuration: const Duration(milliseconds: UFUtils.transitionDuration),
    );
  }
}