rmtmckenzie / flutter_native_device_orientation

Native device orientation plugin for flutter.
MIT License
76 stars 63 forks source link

Android: Sensor returns correct orientation but `onOrientationChanged(useSensor: true)` does not fire. #32

Open MRobertEvers opened 3 years ago

MRobertEvers commented 3 years ago

It appears onOrientationChanged(useSensor: true) does not fire an event when the sensor orientation changes. However, the correct orientation is reported when the sensor is read manually.

This can be seen in android on the official example.

Any suggested workarounds? I may get around to fixing this myself, but I don't have time right now.

MRobertEvers commented 3 years ago

Additional info, NativeDeviceOrientationReader widget works.

NativeDeviceOrientationReader(
  builder: (context) { },
  useSensor: true,
)
rmtmckenzie commented 2 years ago

I haven't been able to reproduce this. Closing unless I receive additional feedback.

LeNgocHiep commented 1 year ago

same issue on version 1.1.4, working on Samsung A53 but not working on Samsung S10+. NativeDeviceOrientationReader widget works.

rmtmckenzie commented 1 year ago

Can you give me a bit more information? Does it never call back at all on Samsung S10+ no matter which way you turn the device? Do you have auto-rotate enabled? Is the activity rotating or set to not rotate?

LeNgocHiep commented 1 year ago

Yes, never call back at all on Samsung S10+. This package works for me https://pub.dev/packages/device_orientation. I have some config below

image image