-
Notifications
You must be signed in to change notification settings - Fork 9.8k
[camera] Remove deprecated Optional type #6870
Conversation
Are you able to see the analysis errors locally? |
@camsim99 FYI https://github.com/google/quiver-dart/pull/717/files, the flutter/flutter tree is unbroken. Probably still worth removing Optional (it will eventually be deprecated), but at least this isn't a tree blocker |
quiver will 3.2.1 un-deprecate |
packages/camera/camera/pubspec.yaml
Outdated
@@ -4,7 +4,7 @@ description: A Flutter plugin for controlling the camera. Supports previewing | |||
Dart. | |||
repository: https://github.com/flutter/plugins/tree/main/packages/camera/camera | |||
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+camera%22 | |||
version: 0.10.0+5 | |||
version: 0.10.0+6 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we bump this to 0.11 since we're changing a public API?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cod changes LGTM. This seems like we're changing a public API though, so I think we should bump the y part of the versions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
* 697c8b3ee [image_picker_ios] Pass through error message from image saving (flutter/plugins#6858) * 72f810851 [local_auth] Bump `intl` from ^0.17.0 to ">=0.17.0 <0.19.0" (flutter/plugins#6848) * acbe9b452 [gh_actions]: Bump github/codeql-action from 2.1.35 to 2.1.37 (flutter/plugins#6860) * 3d8b73bf0 [camera] Remove deprecated Optional type (flutter/plugins#6870) * c5220efae [in_app_purchase] Add support for macOS (flutter/plugins#6519) * 54fc2066d Roll Flutter from 028c6e2 to dbc9306 (11 revisions) (flutter/plugins#6849)
@@ -372,9 +367,7 @@ class CameraController extends ValueNotifier<CameraValue> { | |||
} | |||
try { | |||
await CameraPlatform.instance.resumePreview(_cameraId); | |||
value = value.copyWith( | |||
isPreviewPaused: false, | |||
previewPauseOrientation: const Optional<DeviceOrientation>.absent()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately this seems to break camera orientation changes while preview is paused. Since copyWith
can no longer be told to clear previewPauseOrientation
, it keeps its stale value and locks the CameraPreview
widget in the old orientation until the next pausePreview
call.
A few of the other fields appear to be nullable as well, but I haven't looked closely to see if there are any other regressions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh ok, sorry I didn't realize this. I may have to do some refactoring where Optional<DeviceOrientation>
was used. Thanks for letting me know!
Removing Optional from CameraValue.copyWith caused a regression handling device orientation changes while the preview was paused. This reverts commit 3d8b73b.
This reverts commit 3d8b73b.
…#117456) * 697c8b3ee [image_picker_ios] Pass through error message from image saving (flutter/plugins#6858) * 72f810851 [local_auth] Bump `intl` from ^0.17.0 to ">=0.17.0 <0.19.0" (flutter/plugins#6848) * acbe9b452 [gh_actions]: Bump github/codeql-action from 2.1.35 to 2.1.37 (flutter/plugins#6860) * 3d8b73bf0 [camera] Remove deprecated Optional type (flutter/plugins#6870) * c5220efae [in_app_purchase] Add support for macOS (flutter/plugins#6519) * 54fc2066d Roll Flutter from 028c6e2 to dbc9306 (11 revisions) (flutter/plugins#6849)
* Remove Optional * Undo accidental order change * Fix examples analyze * Remove unused import * Bump versions * Correct version
…tions (#6911) * Add flag * Add missing comment * Add tests * Bump versions * Stage changelog changes * Revert "Fix examples analyze" This reverts commit 4db1858. * Revert "[camera] Remove deprecated Optional type (#6870)" This reverts commit 3d8b73b. * Add back optional * Edit changelog * Fix semicolon * Add )
Removing Optional from CameraValue.copyWith caused a regression handling device orientation changes while the preview was paused. This reverts commit 3d8b73b. # Conflicts: # packages/camera/camera/CHANGELOG.md # packages/camera/camera/lib/src/camera_controller.dart # packages/camera/camera/pubspec.yaml # packages/camera/camera_android/CHANGELOG.md # packages/camera/camera_android/pubspec.yaml # packages/camera/camera_avfoundation/CHANGELOG.md # packages/camera/camera_avfoundation/pubspec.yaml
Fixes flutter/flutter#117403.
Removes deprecated
Optional
type from camera plugin to fix failing frameworkLinux_plugins
test., e.g. https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8794239165172938017/+/u/run_test.dart_for_flutter_plugins_shard_and_subshard_analyze/test_stdout.Pre-launch Checklist
dart format
.)[shared_preferences]
pubspec.yaml
with an appropriate new version according to the pub versioning philosophy, or this PR is exempt from version changes.CHANGELOG.md
to add a description of the change, following repository CHANGELOG style.///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.