Skip to content

Commit dc59984

Browse files
emit event when no results (#26)
1 parent 983bb32 commit dc59984

File tree

3 files changed

+8
-10
lines changed

3 files changed

+8
-10
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## [2.0.0] - 2/05/2019
2+
3+
* We now forward the result from firebase_ml_vision for onResult
4+
15
## [1.4.0] - 24/04/2019
26

37
* add cameraLensDirection parameter (this default to back)

lib/flutter_camera_ml_vision.dart

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ class CameraMlVisionState<T> extends State<CameraMlVision<T>> {
8383
_lastImage = '${tempDir.path}/${DateTime.now().millisecondsSinceEpoch}';
8484
try {
8585
await _cameraController.takePicture(_lastImage);
86-
} on PlatformException catch (_) {
87-
print(_);
86+
} on PlatformException catch (e) {
87+
debugPrint('$e');
8888
}
8989

9090
await _stop(false);
@@ -248,13 +248,7 @@ class CameraMlVisionState<T> extends State<CameraMlVision<T>> {
248248
_alreadyCheckingImage = true;
249249
try {
250250
final T results = await _detect<T>(cameraImage, _detector, _rotation);
251-
if (results != null) {
252-
if (results is List && results.length > 0) {
253-
widget.onResult(results);
254-
} else if (results is! List) {
255-
widget.onResult(results);
256-
}
257-
}
251+
widget.onResult(results);
258252
} catch (ex, stack) {
259253
debugPrint('$ex, $stack');
260254
}

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: flutter_camera_ml_vision
22
description: A flutter widget that show the camera stream and allow ML vision recognition on it, it allow you to detect barcodes, labels, text, faces...
3-
version: 1.5.1
3+
version: 2.0.0
44
authors:
55
- Jimmy Aumard <[email protected]>
66
- Rushio Consulting <[email protected]>

0 commit comments

Comments
 (0)