showSafaehInfo function

Future<bool?> showSafaehInfo({
  1. required BuildContext context,
  2. required String title,
  3. required String content,
  4. required String primaryLabel,
  5. String? secondaryLabel,
  6. bool showSecondaryAction = true,
  7. SafaehTitleBuilder? titleBuilder,
  8. SafaehTitleBuilder? contentBuilder,
  9. double railWidthOf(
    1. BuildContext context
    )?,
  10. SafaehTransition? fadeScale,
  11. SafaehTransition? slideUp,
  12. SafaehPhoneSheetPlacement phonePlacement = SafaehPhoneSheetPlacement.bottom,
  13. double? tabletBreakpoint,
  14. Duration? motion,
  15. Curve? enterCurve,
  16. Curve? exitCurve,
  17. double? maxWidth,
  18. double? maxHeight,
  19. bool barrierDismissible = true,
  20. bool useRootNavigator = true,
  21. SafaehRouteOptions? route,
})

Informational modal with a content panel and a primary action.

Phone: optional secondary (cancel) in the footer. Tablet+: close chrome is the dismiss path.

Implementation

Future<bool?> showSafaehInfo({
  required BuildContext context,
  required String title,
  required String content,
  required String primaryLabel,
  String? secondaryLabel,
  bool showSecondaryAction = true,
  SafaehTitleBuilder? titleBuilder,
  SafaehTitleBuilder? contentBuilder,
  double Function(BuildContext context)? railWidthOf,
  SafaehTransition? fadeScale,
  SafaehTransition? slideUp,
  SafaehPhoneSheetPlacement phonePlacement = SafaehPhoneSheetPlacement.bottom,
  double? tabletBreakpoint,
  Duration? motion,
  Curve? enterCurve,
  Curve? exitCurve,
  double? maxWidth,
  double? maxHeight,
  bool barrierDismissible = true,
  bool useRootNavigator = true,
  SafaehRouteOptions? route,
}) {
  final tokens = SafaehTheme.of(context);
  final breakpoint = tabletBreakpoint ?? tokens.tabletBreakpoint;
  return showSafaeh<bool>(
    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: SafaehInfoSheet(
      title: title,
      content: content,
      primaryLabel: primaryLabel,
      secondaryLabel: secondaryLabel,
      showSecondaryAction: showSecondaryAction,
      titleBuilder: titleBuilder,
      contentBuilder: contentBuilder,
      tabletBreakpoint: breakpoint,
    ),
  );
}