Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix crash when poping a route with the camera preview #32

Merged
merged 2 commits into from
May 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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