showAdaptiveActionSheet<T> function

Future<T?> showAdaptiveActionSheet<T>({
  1. required BuildContext context,
  2. required List<BottomSheetAction> actions,
  3. Widget? title,
  4. CancelAction? cancelAction,
  5. Color? barrierColor,
  6. Color? bottomSheetColor,
})

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.

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

Implementation

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

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