Committed by
GitHub
Merge pull request #152 from juliansteenbakker/return-type
bug: fixed return type of analyzeImage
Showing
1 changed file
with
3 additions
and
1 deletions
| @@ -260,7 +260,9 @@ class MobileScannerController { | @@ -260,7 +260,9 @@ class MobileScannerController { | ||
| 260 | /// | 260 | /// |
| 261 | /// [path] The path of the image on the devices | 261 | /// [path] The path of the image on the devices |
| 262 | Future<bool> analyzeImage(String path) async { | 262 | Future<bool> analyzeImage(String path) async { |
| 263 | - return methodChannel.invokeMethod('analyzeImage', path) as bool; | 263 | + return methodChannel |
| 264 | + .invokeMethod<bool>('analyzeImage', path) | ||
| 265 | + .then<bool>((bool? value) => value ?? false); | ||
| 264 | } | 266 | } |
| 265 | 267 | ||
| 266 | /// Disposes the MobileScannerController and closes all listeners. | 268 | /// Disposes the MobileScannerController and closes all listeners. |
-
Please register or login to post a comment