Skip to content
Merged
Show file tree
Hide file tree
Changes from 9 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 packages/camera/camera_android/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.10.10+10

* Updates Java compatibility version to 17.

## 0.10.10+9

* Resolves Gradle 9 deprecations.
Expand Down
4 changes: 2 additions & 2 deletions packages/camera/camera_android/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ buildFeatures {
disable 'AndroidGradlePluginVersion', 'InvalidPackage', 'GradleDependency', 'NewerVersionAvailable'
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

testOptions {
Expand Down
2 changes: 1 addition & 1 deletion packages/camera/camera_android/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: Android implementation of the camera plugin.
repository: https://github.com/flutter/packages/tree/main/packages/camera/camera_android
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+camera%22

version: 0.10.10+9
version: 0.10.10+10

environment:
sdk: ^3.9.0
Expand Down
4 changes: 4 additions & 0 deletions packages/camera/camera_android_camerax/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.6.23+2

* Updates Java compatibility version to 17 and minimum supported SDK version to Flutter 3.35/Dart 3.9.

## 0.6.23+1

* Resolves Gradle 9 deprecations.
Expand Down
6 changes: 3 additions & 3 deletions packages/camera/camera_android_camerax/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ android {
compileSdk = flutter.compileSdkVersion

compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

kotlinOptions {
// This must match the Java version provided in compileOptions.
jvmTarget = '11'
jvmTarget = JavaVersion.VERSION_17.toString()
}

defaultConfig {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,9 @@ void main() {
testWidgets('availableCameras only supports valid back or front cameras', (
WidgetTester tester,
) async {
final List<CameraDescription> availableCameras =
await CameraPlatform.instance.availableCameras();
final List<CameraDescription> availableCameras = await CameraPlatform
.instance
.availableCameras();

for (final CameraDescription cameraDescription in availableCameras) {
expect(
Expand All @@ -63,8 +64,8 @@ void main() {
testWidgets('Preview takes expected resolution from preset', (
WidgetTester tester,
) async {
final List<CameraDescription> cameras =
await CameraPlatform.instance.availableCameras();
final List<CameraDescription> cameras = await CameraPlatform.instance
.availableCameras();
if (cameras.isEmpty) {
return;
}
Expand Down Expand Up @@ -104,8 +105,8 @@ void main() {
testWidgets('Images from streaming have expected resolution from preset', (
WidgetTester tester,
) async {
final List<CameraDescription> cameras =
await CameraPlatform.instance.availableCameras();
final List<CameraDescription> cameras = await CameraPlatform.instance
.availableCameras();
if (cameras.isEmpty) {
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,20 +187,17 @@ class CameraValue {
exposurePointSupported ?? this.exposurePointSupported,
focusPointSupported: focusPointSupported ?? this.focusPointSupported,
deviceOrientation: deviceOrientation ?? this.deviceOrientation,
lockedCaptureOrientation:
lockedCaptureOrientation == null
? this.lockedCaptureOrientation
: lockedCaptureOrientation.orNull,
recordingOrientation:
recordingOrientation == null
? this.recordingOrientation
: recordingOrientation.orNull,
lockedCaptureOrientation: lockedCaptureOrientation == null
? this.lockedCaptureOrientation
: lockedCaptureOrientation.orNull,
recordingOrientation: recordingOrientation == null
? this.recordingOrientation
: recordingOrientation.orNull,
isPreviewPaused: isPreviewPaused ?? this.isPreviewPaused,
description: description ?? this.description,
previewPauseOrientation:
previewPauseOrientation == null
? this.previewPauseOrientation
: previewPauseOrientation.orNull,
previewPauseOrientation: previewPauseOrientation == null
? this.previewPauseOrientation
: previewPauseOrientation.orNull,
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,24 +23,23 @@ class CameraPreview extends StatelessWidget {
Widget build(BuildContext context) {
return controller.value.isInitialized
? ValueListenableBuilder<CameraValue>(
valueListenable: controller,
builder: (BuildContext context, Object? value, Widget? child) {
return AspectRatio(
aspectRatio:
_isLandscape()
? controller.value.aspectRatio
: (1 / controller.value.aspectRatio),
child: Stack(
fit: StackFit.expand,
children: <Widget>[
_wrapInRotatedBox(child: controller.buildPreview()),
child ?? Container(),
],
),
);
},
child: child,
)
valueListenable: controller,
builder: (BuildContext context, Object? value, Widget? child) {
return AspectRatio(
aspectRatio: _isLandscape()
? controller.value.aspectRatio
: (1 / controller.value.aspectRatio),
child: Stack(
fit: StackFit.expand,
children: <Widget>[
_wrapInRotatedBox(child: controller.buildPreview()),
child ?? Container(),
],
),
);
},
child: child,
)
: Container();
}

Expand Down Expand Up @@ -73,7 +72,7 @@ class CameraPreview extends StatelessWidget {
return controller.value.isRecordingVideo
? controller.value.recordingOrientation!
: (controller.value.previewPauseOrientation ??
controller.value.lockedCaptureOrientation ??
controller.value.deviceOrientation);
controller.value.lockedCaptureOrientation ??
controller.value.deviceOrientation);
}
}
Loading