-
Notifications
You must be signed in to change notification settings - Fork 9.8k
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.
Everything looks good, but this still lacks tests. Potentially a widget test?
@bparrishMines on iOS this indeed looks good but on Android I am running into the following problem: https://discord.com/channels/608014603317936148/608020293944082452/815873332574158890 (if you have a solution or advise I would love to hear it) I will mark the PR as draft until this gets resolved. And I will also make sure to add tests. |
return turns[_getApplicableOrientation()]!; | ||
} | ||
|
||
DeviceOrientation _getApplicableOrientation() { |
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.
Just to confirm, there is no diff in this method right? The method was just moved down?
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.
Correct, it made more sense to me to keep it closer to where it was used. I see now that it causes a bit of noice
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.
keeping it close to where it was used makes sense to me!
@bparrishMines I have added some widget tests to make sure the rotated box turns correctly according to the different settings provided by the |
73fe7f7
to
0417103
Compare
@mvanbeusekom As stated on Discord, Camera2 on Android automatically changes the orientation of the output while iOS requires you to set the value. On iOS, have you tried listening to the the UIDeviceOrientationDidChangeNotification and automatically updating the output camera preview orientation? I don't think there's anything that can be done on Android about Orientation since we use a |
Yes that is exactly what I did in this pull request, which we tested extensively and solves all orientation issues on iOS without the need of a I was just wondering if we could do something similar on Android so we could remove the So in conclusion, this PR should be ready and would be great if you could review it. |
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
In my case, updating to a new version did not fix this problem RPReplay_Final1623858543.MP4 |
This PR fixes an issue where on iOS the default orientation was set to landscape right while it should have been set to portrait up. To compensate for this problem the
CameraPreview
widget used an additional offset when calculating the rotation on iOS.This PR solves the problem at the root and also removed the extra offset needed on iOS to adjust the orientation.
If you had to change anything in the flutter/tests repo, include a link to the migration guide as per the breaking change policy.
Pre-launch Checklist
[shared_preferences]
///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.