Skip to content

Commit

Permalink
fix crash when poping a route with the camera preview (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kleak authored May 5, 2019
1 parent 72c20e3 commit 6fb9a2d
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## [2.0.1] - 5/05/2019

* fix a crash when poping a route with the camera preview

## [2.0.0] - 2/05/2019

* We now forward the result from firebase_ml_vision for onResult
Expand Down
2 changes: 1 addition & 1 deletion example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ packages:
path: ".."
relative: true
source: path
version: "2.0.0"
version: "2.0.1"
flutter_test:
dependency: "direct dev"
description: flutter
Expand Down
10 changes: 6 additions & 4 deletions lib/flutter_camera_ml_vision.dart
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,12 @@ class CameraMlVisionState<T> extends State<CameraMlVision<T>> {
}
}

Future<void> _stop(bool silently) async {
if (_cameraController.value.isStreamingImages) {
await _cameraController.stopImageStream();
}
void _stop(bool silently) {
Future.microtask(() async {
if (_cameraController?.value?.isStreamingImages == true && mounted) {
await _cameraController.stopImageStream();
}
});

if (silently) {
_isStreaming = false;
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: flutter_camera_ml_vision
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...
version: 2.0.0
version: 2.0.1
authors:
- Jimmy Aumard <[email protected]>
- Rushio Consulting <[email protected]>
Expand Down

0 comments on commit 6fb9a2d

Please sign in to comment.