Toggle navigation
Toggle navigation
This project
Loading...
Sign in
flutter_package
/
mobile_scanner
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
Navaron Bracke
2023-11-29 19:34:34 +0100
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
45197a4f5fc184381b57bf1a5858a88eeea886f0
45197a4f
1 parent
e634239f
check if torch mode is supported on MacOS
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
macos/Classes/MobileScannerPlugin.swift
macos/Classes/MobileScannerPlugin.swift
View file @
45197a4
...
...
@@ -320,7 +320,11 @@ public class MobileScannerPlugin: NSObject, FlutterPlugin, FlutterStreamHandler,
// TODO: this method should be removed when iOS and MacOS share their implementation.
private
func
toggleTorchInternal
(
_
torch
:
AVCaptureDevice
.
TorchMode
)
throws
{
if
(
device
==
nil
||
!
device
.
hasTorch
)
{
guard
let
device
=
self
.
device
else
{
return
}
if
(
!
device
.
hasTorch
||
!
device
.
isTorchModeSupported
(
torch
))
{
return
}
...
...
@@ -337,7 +341,7 @@ public class MobileScannerPlugin: NSObject, FlutterPlugin, FlutterStreamHandler,
}
}
func
toggleTorch
(
_
call
:
FlutterMethodCall
,
_
result
:
@escaping
FlutterResult
)
{
private
func
toggleTorch
(
_
call
:
FlutterMethodCall
,
_
result
:
@escaping
FlutterResult
)
{
let
requestedTorchMode
:
AVCaptureDevice
.
TorchMode
=
call
.
arguments
as!
Int
==
1
?
.
on
:
.
off
do
{
...
...
Please
register
or
login
to post a comment