diff --git a/packages/smooth_app/lib/pages/scan/scan_page.dart b/packages/smooth_app/lib/pages/scan/scan_page.dart index 89c986e159f..cdf39d377e4 100644 --- a/packages/smooth_app/lib/pages/scan/scan_page.dart +++ b/packages/smooth_app/lib/pages/scan/scan_page.dart @@ -12,6 +12,7 @@ import 'package:smooth_app/generic_lib/design_constants.dart'; import 'package:smooth_app/generic_lib/dialogs/smooth_alert_dialog.dart'; import 'package:smooth_app/generic_lib/widgets/smooth_card.dart'; import 'package:smooth_app/helpers/app_helper.dart'; +import 'package:smooth_app/helpers/camera_helper.dart'; import 'package:smooth_app/helpers/haptic_feedback_helper.dart'; import 'package:smooth_app/helpers/permission_helper.dart'; import 'package:smooth_app/pages/scan/camera_scan_page.dart'; @@ -65,6 +66,7 @@ class _ScanPageState extends State { final AppLocalizations appLocalizations = AppLocalizations.of(context); final TextDirection direction = Directionality.of(context); + final bool hasACamera = CameraHelper.hasACamera; return SmoothScaffold( brightness: @@ -74,26 +76,27 @@ class _ScanPageState extends State { body: SafeArea( child: Column( children: [ - Expanded( - flex: 100 - _carouselHeightPct, - child: Consumer( - builder: ( - BuildContext context, - PermissionListener listener, - _, - ) { - switch (listener.value.status) { - case DevicePermissionStatus.checking: - return EMPTY_WIDGET; - case DevicePermissionStatus.granted: - // TODO(m123): change - return const CameraScannerPage(); - default: - return const _PermissionDeniedCard(); - } - }, + if (hasACamera) + Expanded( + flex: 100 - _carouselHeightPct, + child: Consumer( + builder: ( + BuildContext context, + PermissionListener listener, + _, + ) { + switch (listener.value.status) { + case DevicePermissionStatus.checking: + return EMPTY_WIDGET; + case DevicePermissionStatus.granted: + // TODO(m123): change + return const CameraScannerPage(); + default: + return const _PermissionDeniedCard(); + } + }, + ), ), - ), Expanded( flex: _carouselHeightPct, child: Padding(