ShowUFUBottomSheet function
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),
);
}
}