showAdaptiveActionSheet<T> function Null safety

Future<T?> showAdaptiveActionSheet<T>(
  1. {required BuildContext context,
  2. Widget? title,
  3. required List<BottomSheetAction> actions,
  4. CancelAction? cancelAction,
  5. Color? barrierColor,
  6. Color? bottomSheetColor,
  7. double? androidBorderRadius,
  8. bool isDismissible = true}
)

A action bottom sheet that adapts to the platform (Android/iOS).

actions The Actions list that will appear on the ActionSheet. (required)

cancelAction The optional cancel button that show under the actions (grouped separately on iOS).

title The optional title widget that show above the actions.

androidBorderRadius The android border radius.

The optional backgroundColor and barrierColor can be passed in to customize the appearance and behavior of persistent bottom sheets.

The optional isDismissible can be passed to set barrierDismissible of showCupertinoModalPopup and isDismissible of showModalBottomSheet (Default true as for both implementations)

Implementation

Future<T?> showAdaptiveActionSheet<T>({
  required BuildContext context,
  Widget? title,
  required List<BottomSheetAction> actions,
  CancelAction? cancelAction,
  Color? barrierColor,
  Color? bottomSheetColor,
  double? androidBorderRadius,
  bool isDismissible = true,
}) async {
  assert(
    barrierColor != Colors.transparent,
    'The barrier color cannot be transparent.',
  );

  return _show<T>(
    context,
    title,
    actions,
    cancelAction,
    barrierColor,
    bottomSheetColor,
    androidBorderRadius,
    isDismissible: isDismissible,
  );
}