showSafaehCameraSheet<T> function
Future<T?>
showSafaehCameraSheet<T>({
- required BuildContext context,
- required SafaehCameraSheetBuilder builder,
- double? compactHeightFraction,
- Color panelColor = Colors.black,
- Duration? motion,
- Duration? roll,
- Curve? enterCurve,
- Curve? exitCurve,
- double railWidthOf(
- BuildContext context
- bool barrierDismissible = true,
- String? handleExpandLabel,
- String? handleCollapseLabel,
- String? handleDismissLabel,
- SafaehFloatingAppearance? floatingAppearance,
Opens a black paper-roll sheet (receipt camera / QR scanner).
barrierDismissible gates scrim tap and system back. The framework
route stays non-dismissible so SafaehCameraSheet.interceptDismiss
still runs on those paths.
Implementation
Future<T?> showSafaehCameraSheet<T>({
required BuildContext context,
required SafaehCameraSheetBuilder builder,
double? compactHeightFraction,
Color panelColor = Colors.black,
Duration? motion,
Duration? roll,
Curve? enterCurve,
Curve? exitCurve,
double Function(BuildContext context)? railWidthOf,
bool barrierDismissible = true,
bool useRootNavigator = true,
String? handleExpandLabel,
String? handleCollapseLabel,
String? handleDismissLabel,
SafaehFloatingAppearance? floatingAppearance,
}) {
final tokens = SafaehTheme.of(context);
final resolvedFloatingAppearance =
floatingAppearance ?? tokens.floatingAppearance;
return showGeneralDialog<T>(
context: context,
useRootNavigator: useRootNavigator,
barrierDismissible: false,
barrierLabel: MaterialLocalizations.of(context).modalBarrierDismissLabel,
barrierColor: Colors.transparent,
transitionDuration: safaehResolvedMotion(context, roll ?? tokens.sheetRoll),
pageBuilder: (ctx, animation, secondaryAnimation) {
return SafaehCameraSheetHost(
openAnimation: animation,
compactHeightFraction: compactHeightFraction,
panelColor: panelColor,
motion: motion,
enterCurve: enterCurve,
exitCurve: exitCurve,
railWidthOf: railWidthOf,
barrierDismissible: barrierDismissible,
useRootNavigator: useRootNavigator,
handleExpandLabel: handleExpandLabel,
handleCollapseLabel: handleCollapseLabel,
handleDismissLabel: handleDismissLabel,
floatingAppearance: resolvedFloatingAppearance,
builder: builder,
);
},
transitionBuilder: (ctx, animation, secondaryAnimation, child) => child,
);
}