showSafaehCameraSheet<T> function

Future<T?> showSafaehCameraSheet<T>({
  1. required BuildContext context,
  2. required SafaehCameraSheetBuilder builder,
  3. double? compactHeightFraction,
  4. Color panelColor = Colors.black,
  5. Duration? motion,
  6. Duration? roll,
  7. Curve? enterCurve,
  8. Curve? exitCurve,
  9. double railWidthOf(
    1. BuildContext context
    )?,
  10. bool barrierDismissible = true,
  11. bool useRootNavigator = true,
  12. String? handleExpandLabel,
  13. String? handleCollapseLabel,
  14. String? handleDismissLabel,
  15. 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,
  );
}