showSafaehPicker<T> function

Future<T?> showSafaehPicker<T>({
  1. required BuildContext context,
  2. String? title,
  3. required List<SafaehOption<T>> options,
  4. T? selected,
  5. String? footer,
  6. SafaehTitleBuilder? titleBuilder,
  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. bool showTitleInBody = true,
  20. SafaehRouteOptions? route,
})

Compact single-select picker. Wide = dialog, phone = bottom sheet.

Implementation

Future<T?> showSafaehPicker<T>({
  required BuildContext context,
  String? title,
  required List<SafaehOption<T>> options,
  T? selected,
  String? footer,
  SafaehTitleBuilder? titleBuilder,
  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,
  bool showTitleInBody = 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,
    barrierDismissible: barrierDismissible,
    motion: motion,
    enterCurve: enterCurve,
    exitCurve: exitCurve,
    railWidthOf: railWidthOf,
    fadeScale: fadeScale,
    slideUp: slideUp,
    phonePlacement: phonePlacement,
    useRootNavigator: useRootNavigator,
    paintPhoneTitle: !showTitleInBody,
    route: route,
    child: SafaehOptionPickerBody<T>(
      title: title,
      titleBuilder: titleBuilder,
      options: options,
      selected: selected,
      footer: footer,
      tabletBreakpoint: breakpoint,
      showTitleInBody: showTitleInBody,
    ),
  );
}