basic static method

void basic({
  1. required String? title,
  2. required Widget content,
  3. TextStyle? titleStyle,
  4. Color? backgroundColor,
  5. Color? barrierColor,
  6. bool? isDismissible,
  7. bool? isScrolled,
  8. bool? persistent,
  9. double? radius,
  10. bool? showDivider = true,
  11. bool? showDragIndicator = true,
  12. double? padding,
})

Implementation

static void basic({
  required String? title,
  required Widget content,
  TextStyle? titleStyle,
  Color? backgroundColor,
  Color? barrierColor,
  bool? isDismissible,
  bool? isScrolled,
  bool? persistent,
  double? radius,
  bool? showDivider = true,
  bool? showDragIndicator = true,
  double? padding,
}) {
  // add haptic feedback (UX)
  HapticFeedback.lightImpact();
  Get.bottomSheet(
    SafeArea(
      child: VStack(
        [
          if (showDragIndicator == true) ExDashLine().pSymmetric(v: 24),
          if (title != null) ...[
            title.text.bold
                .size(18)
                .maxLines(2)
                .textStyle(titleStyle)
                .ellipsis
                .make()
                .pOnly(bottom: 8)
                .pSymmetric(h: 24)
                .pOnly(top: showDragIndicator == true ? 0 : 16),
            if (showDivider == true)
              Divider().pOnly(bottom: 8)
            else
              8.heightBox,
          ],
          content.pSymmetric(h: padding ?? 24),
        ],
      ),
    ).w(double.infinity),
    backgroundColor: backgroundColor ?? Get.theme.cardColor,
    barrierColor: barrierColor,
    isDismissible: isDismissible ?? true,
    persistent: persistent ?? true,
    isScrollControlled: isScrolled ?? true,
    enableDrag: true,
    shape: RoundedRectangleBorder(
      borderRadius: BorderRadius.only(
        topLeft: Radius.circular(radius ?? 16),
        topRight: Radius.circular(radius ?? 16),
      ),
    ),
  );
}