showSafaehActionSheet<T> function

Future<T?> showSafaehActionSheet<T>({
  1. required BuildContext context,
  2. required String title,
  3. required List<SafaehAction<T>> actions,
  4. Widget? header,
  5. SafaehTitleBuilder? titleBuilder,
  6. SafaehActionTileBuilder<T>? tileBuilder,
  7. double railWidthOf(
    1. BuildContext context
    )?,
  8. double? tabletBreakpoint,
  9. double? maxWidth,
  10. double? maxHeight,
  11. bool barrierDismissible = true,
  12. Duration? motion,
  13. Curve? enterCurve,
  14. Curve? exitCurve,
  15. SafaehTransition? fadeScale,
  16. SafaehTransition? slideUp,
  17. SafaehPhoneSheetPlacement phonePlacement = SafaehPhoneSheetPlacement.bottom,
  18. bool useRootNavigator = true,
  19. SafaehRouteOptions? route,
})

Action menu. Wide = dialog, phone = bottom sheet.

Implementation

Future<T?> showSafaehActionSheet<T>({
  required BuildContext context,
  required String title,
  required List<SafaehAction<T>> actions,
  Widget? header,
  SafaehTitleBuilder? titleBuilder,
  SafaehActionTileBuilder<T>? tileBuilder,
  double Function(BuildContext context)? railWidthOf,
  double? tabletBreakpoint,
  double? maxWidth,
  double? maxHeight,
  bool barrierDismissible = true,
  Duration? motion,
  Curve? enterCurve,
  Curve? exitCurve,
  SafaehTransition? fadeScale,
  SafaehTransition? slideUp,
  SafaehPhoneSheetPlacement phonePlacement = SafaehPhoneSheetPlacement.bottom,
  bool useRootNavigator = true,
  SafaehRouteOptions? route,
}) {
  final tokens = SafaehTheme.of(context);
  final breakpoint = tabletBreakpoint ?? tokens.tabletBreakpoint;
  return showSafaeh<T>(
    context: context,
    title: title,
    titleBuilder: titleBuilder,
    tabletBreakpoint: breakpoint,
    maxWidth: maxWidth,
    maxHeight: maxHeight ?? MediaQuery.sizeOf(context).height * 0.75,
    barrierDismissible: barrierDismissible,
    motion: motion,
    enterCurve: enterCurve,
    exitCurve: exitCurve,
    railWidthOf: railWidthOf,
    fadeScale: fadeScale,
    slideUp: slideUp,
    phonePlacement: phonePlacement,
    useRootNavigator: useRootNavigator,
    paintPhoneTitle: true,
    route: route,
    child: SafaehActionSheetBody<T>(
      actions: actions,
      header: header,
      tileBuilder: tileBuilder,
    ),
  );
}