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

allow user to choose camera lens direction #15

Merged
merged 2 commits into from
Apr 24, 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.
Jump to
Jump to file
Failed to load files.
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 @@
## [1.4.0] - 24/04/2019

* add cameraLensDirection parameter (this default to back)

## [1.3.0] - 17/04/2019

* add overlayBuilder parameter
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: "1.3.0"
version: "1.4.0"
flutter_test:
dependency: "direct dev"
description: flutter
Expand Down
5 changes: 4 additions & 1 deletion lib/flutter_camera_ml_vision.dart
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class CameraMlVision<T> extends StatefulWidget {
final WidgetBuilder loadingBuilder;
final ErrorWidgetBuilder errorBuilder;
final WidgetBuilder overlayBuilder;
final CameraLensDirection cameraLensDirection;

CameraMlVision({
Key key,
Expand All @@ -45,6 +46,7 @@ class CameraMlVision<T> extends StatefulWidget {
this.loadingBuilder,
this.errorBuilder,
this.overlayBuilder,
this.cameraLensDirection = CameraLensDirection.back,
}) : super(key: key);

@override
Expand Down Expand Up @@ -134,7 +136,8 @@ class CameraMlVisionState<T> extends State<CameraMlVision<T>> {
}
}

CameraDescription description = await _getCamera(CameraLensDirection.back);
CameraDescription description =
await _getCamera(widget.cameraLensDirection);
if (description == null) {
_cameraMlVisionState = _CameraState.error;
_cameraError = CameraError.noCameraAvailable;
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: 1.3.0
version: 1.4.0
authors:
- Jimmy Aumard <jimmy.aumard@gmail.com>
- Kevin Segaud <kevin@santetis.fr>
Expand Down