Closed mrietunjoy closed 1 year ago
So, currently I think it is respected in iPad. I have shared a link below which shows the limitation, of this approach.
https://api.flutter.dev/flutter/services/SystemChrome/setPreferredOrientations.html
And if anyone is checking for this issue. The above code will work for one particular Orientation like PortraitUp or PortraitDown which ever is placed in the array first.
But if you want to assign a Orientation then there is no need for the above code. For more details on DeviceOrientation you can check, the docs: https://api.flutter.dev/flutter/services/DeviceOrientation-class.html
Hi, while you are setting the device orientation, the orientation is set as per only the first item in the array which is sent as a argument of setPreferredOrientations in main.dart. Line 10.
I tried running it in a virtual device as well as a Mobile device. But if the first item is changed only then it comes to effect.
DeviceOrientation.landscapeLeft
Desktop (please complete the following information):
Smartphone (please complete the following information):
Thanks