showSafaehInfo function
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 railWidthOf(
- BuildContext context
- SafaehTransition? fadeScale,
- SafaehTransition? slideUp,
- SafaehPhoneSheetPlacement phonePlacement = SafaehPhoneSheetPlacement.bottom,
- double? tabletBreakpoint,
- Duration? motion,
- Curve? enterCurve,
- Curve? exitCurve,
- double? maxWidth,
- double? maxHeight,
- bool barrierDismissible = true,
- 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,
),
);
}