showSafaehTilePicker<T> function

Future<T?> showSafaehTilePicker<T>({
  1. required BuildContext context,
  2. required List<SafaehTileOption<T>> options,
  3. String? title,
  4. SafaehTitleBuilder? titleBuilder,
  5. Widget? header,
  6. T? selected,
  7. SafaehTileBuilder<T>? tileBuilder,
  8. double railWidthOf(
    1. BuildContext context
    )?,
  9. double? tabletBreakpoint,
  10. double? maxWidth,
  11. double? maxHeight,
  12. bool barrierDismissible = true,
  13. Duration? motion,
  14. Curve? enterCurve,
  15. Curve? exitCurve,
  16. SafaehTransition? fadeScale,
  17. SafaehTransition? slideUp,
  18. SafaehPhoneSheetPlacement phonePlacement = SafaehPhoneSheetPlacement.bottom,
  19. String? searchHint,
  20. String? searchEmptyLabel,
  21. SafaehTileSearchMatch<T>? searchMatches,
  22. bool useRootNavigator = true,
  23. bool showTitleInBody = true,
  24. SafaehRouteOptions? route,
})

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

Implementation

Future<T?> showSafaehTilePicker<T>({
  required BuildContext context,
  required List<SafaehTileOption<T>> options,
  String? title,
  SafaehTitleBuilder? titleBuilder,
  Widget? header,
  T? selected,
  SafaehTileBuilder<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,
  String? searchHint,
  String? searchEmptyLabel,
  SafaehTileSearchMatch<T>? searchMatches,
  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: SafaehTilePickerBody<T>(
      title: title,
      titleBuilder: titleBuilder,
      header: header,
      options: options,
      selected: selected,
      tileBuilder: tileBuilder,
      tabletBreakpoint: breakpoint,
      showTitleInBody: showTitleInBody,
      searchHint: searchHint,
      searchEmptyLabel: searchEmptyLabel,
      searchMatches: searchMatches,
    ),
  );
}