From cd38a5153b455fb0b384e3bfb9214091f8561406 Mon Sep 17 00:00:00 2001 From: sneurlax Date: Fri, 26 Jul 2024 04:19:52 -0500 Subject: [PATCH] initialize camera on macos and quiet warning re: NSCameraUseContinuityCameraDeviceType --- .../my_stack_view/wallet_view/sub_widgets/desktop_send.dart | 2 ++ macos/Runner/Info.plist | 2 ++ 2 files changed, 4 insertions(+) diff --git a/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_send.dart b/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_send.dart index 94e458976..1d1c52fc6 100644 --- a/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_send.dart +++ b/lib/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/desktop_send.dart @@ -13,6 +13,7 @@ import 'dart:convert'; import 'dart:io'; import 'package:camera_linux/camera_linux.dart'; +import 'package:camera_macos/camera_macos_arguments.dart'; import 'package:camera_macos/camera_macos_controller.dart'; import 'package:camera_macos/camera_macos_device.dart'; import 'package:camera_macos/camera_macos_platform_interface.dart'; @@ -2054,6 +2055,7 @@ class _QrCodeScannerDialogState extends State { throw Exception('No cameras available'); } _macOSDeviceId = videoDevices.first.deviceId; + await CameraMacOS.instance.initialize(cameraMacOSMode: CameraMacOSMode.photo); setState(() { _isCameraOpen = true; diff --git a/macos/Runner/Info.plist b/macos/Runner/Info.plist index 008e69ba5..82ae07c13 100644 --- a/macos/Runner/Info.plist +++ b/macos/Runner/Info.plist @@ -32,5 +32,7 @@ QR Code scanning NSMicrophoneUsageDescription QR Code Scanning. A temporary requirement due to limitations in the camera_macos package that are being worked on to remove the need for this permission. + NSCameraUseContinuityCameraDeviceType +