-
Notifications
You must be signed in to change notification settings - Fork 9.8k
[camera_web] Add createCamera
implementation
#4182
[camera_web] Add createCamera
implementation
#4182
Conversation
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! I'll revert the platform_interface change for now!
packages/camera/camera_platform_interface/lib/src/types/resolution_preset.dart
Outdated
Show resolved
Hide resolved
} | ||
|
||
/// Maps the given [resolutionPreset] to [Size]. | ||
Size mapResolutionPresetToSize(ResolutionPreset resolutionPreset) { |
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 this take in to account the screen orientation? I don't remember if we had to flip the w/h on the photobooth when the app was rotated? Do you remember @felangel?
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.
Hmm, I can see that photobooth records the screen orientation when the photo is being captured. Then, the photo is displayed inside the AspectRatio widget with an aspect ratio based on that orientation but not sure if that has anything to do with flipping the w/h. 🤔
Adds
createCamera
implementation of the camera platform interface.mapFacingModeToCameraType
toCameraSettings
.mapResolutionPresetToSize
toCameraSettings
.createCamera
implementation.availableCameras
to extract the camera type.CameraOptions
.Part of flutter/flutter#45297.
Pre-launch Checklist
dart format
.)[shared_preferences]
///
).