Orientation Builder gives wrong orientation

Posted by Andre Scott | Updated on

Orientation Builder gives wrong orientation

It’s already said in the documentation that

In my case when soft keyboard is opened, width of the screen becomes greater than height(Note that I’m calculating the height as Full Screen Height – Soft Keyboard height.

Thus OrientationBuilder returns as landscape which is the correct behaviour as per documentation.

Hence OrientationBuilder cannot be used for this case.

To solve the issue we can use orientation obtained from MediaQuery

If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers