showPumalModalBottomSheet function

void showPumalModalBottomSheet({
  1. required BuildContext context,
  2. required Widget child,
  3. bool expand = false,
  4. bool safeArea = false,
  5. EdgeInsetsGeometry padding = const EdgeInsets.all(0.0),
  6. PumaModalType modalType = PumaModalType.cupertino,
  7. bool isDismissible = true,
  8. bool enableDrag = true,
})

Implementation

void showPumalModalBottomSheet({
  required BuildContext context,
  required Widget child,
  bool expand = false,
  bool safeArea = false,
  EdgeInsetsGeometry padding = const EdgeInsets.all(0.0),
  PumaModalType modalType = PumaModalType.cupertino,
  bool isDismissible = true,
  bool enableDrag = true,
}) {
  switch (modalType) {
    case PumaModalType.bar:
      showBarModalBottomSheet(
        expand: expand,
        context: context,
        isDismissible: isDismissible,
        enableDrag: enableDrag,
        builder: (context) => PumaPopper(
          padding: padding,
          color: Theme.of(context).colorScheme.background,
          safeArea: safeArea,
          child: child,
        ),
      );
      break;
    default:
      showCupertinoModalBottomSheet(
        backgroundColor: Theme.of(context).colorScheme.background,
        barrierColor: Theme.of(context).colorScheme.onSurface.withAlpha(130),
        expand: expand,
        context: context,
        isDismissible: isDismissible,
        enableDrag: enableDrag,
        builder: (context) => PumaPopper(
          padding: padding,
          color: Theme.of(context).colorScheme.background,
          safeArea: safeArea,
          child: child,
        ),
      );
  }
}