Skip to content

Commit

Permalink
allow user to choose camera lens direction (#15)
Browse files Browse the repository at this point in the history
* allow user to choose camera lens direction

* bump package version and add entry in CHANGELOG
  • Loading branch information
Kleak committed Apr 24, 2019
1 parent 18bcc2c commit 56532d2
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
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

0 comments on commit 56532d2

Please sign in to comment.