Skip to content

Commit

Permalink
add params to set resolution (#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kleak authored Jun 12, 2019
1 parent d0b4db7 commit 106f67a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/flutter_camera_ml_vision.dart
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ class CameraMlVision<T> extends StatefulWidget {
final ErrorWidgetBuilder errorBuilder;
final WidgetBuilder overlayBuilder;
final CameraLensDirection cameraLensDirection;
final ResolutionPreset resolution;

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

@override
Expand Down Expand Up @@ -160,7 +162,9 @@ class CameraMlVisionState<T> extends State<CameraMlVision<T>> {
}
_cameraController = CameraController(
description,
Platform.isIOS ? ResolutionPreset.low : ResolutionPreset.medium,
widget.resolution ?? Platform.isIOS
? ResolutionPreset.low
: ResolutionPreset.medium,
enableAudio: false,
);
if (!mounted) {
Expand Down

0 comments on commit 106f67a

Please sign in to comment.