How to detect landscape orientation when the device is in portrait mode and the app supports only portrait mode in flutter?
Asked Answered
C

0

0

My flutter app only supports portrait mode.

However, on one screen user can take the pic using the camera plugin. Users can take the pic portrait mode or landscape mode(Without changing device orientation).

I want to display a rectangle overlay on top of the camera. So if I can detect the mobile is in landscape or portrait mode I can add x,y, height, width values according to the orientation.

I am not asking about the Orientation builder because my app only supports portrait mode.

I have read some articles about Gyrometer to detect the device orientation. But in flutter, I haven't found code examples.

Caudal answered 21/10, 2020 at 5:24 Comment(2)
pub.dev/packages/native_device_orientation what about this package? This might help you I thinkEthelyn
Check this answer and also my comment thereKristy

© 2022 - 2024 — McMap. All rights reserved.