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
2022-11-21 12:36:52 +0100
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
d48401b321e7723974cbe9dca5aced285de6e9a2
d48401b3
1 parent
2c306ef4
do not throw when calling stop if already stopped
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
9 deletions
android/src/main/kotlin/dev/steenbakker/mobile_scanner/MobileScannerPlugin.kt
ios/Classes/SwiftMobileScannerPlugin.swift
macos/Classes/MobileScannerPlugin.swift
android/src/main/kotlin/dev/steenbakker/mobile_scanner/MobileScannerPlugin.kt
View file @
d48401b
...
...
@@ -208,7 +208,7 @@ class MobileScannerPlugin : FlutterPlugin, ActivityAware, MethodChannel.MethodCa
handler!!.stop()
result.success(null)
} catch (e: AlreadyStopped) {
result.
error("MobileScanner", "Called stop() while already stopped!",
null)
result.
success(
null)
}
}
...
...
ios/Classes/SwiftMobileScannerPlugin.swift
View file @
d48401b
...
...
@@ -107,11 +107,7 @@ public class SwiftMobileScannerPlugin: NSObject, FlutterPlugin {
private
func
stop
(
_
result
:
@escaping
FlutterResult
)
{
do
{
try
mobileScanner
.
stop
()
}
catch
{
result
(
FlutterError
(
code
:
"MobileScanner"
,
message
:
"Called stop() while already stopped!"
,
details
:
nil
))
}
}
catch
{}
result
(
nil
)
}
...
...
macos/Classes/MobileScannerPlugin.swift
View file @
d48401b
...
...
@@ -260,9 +260,8 @@ public class MobileScannerPlugin: NSObject, FlutterPlugin, FlutterStreamHandler,
func
stop
(
_
result
:
FlutterResult
)
{
if
(
device
==
nil
)
{
result
(
FlutterError
(
code
:
"MobileScanner"
,
message
:
"Called stop() while already stopped!"
,
details
:
nil
))
result
(
nil
)
return
}
captureSession
.
stopRunning
()
...
...
Please
register
or
login
to post a comment