Reputation: 11
I am running an app built in Flutter on Pax A920 device with Android 7.1.2 installed.
Whenever the keyboard appears, the screen jumps down, and shows parts of the current view above the screen. When I dismiss the keyboard, everything goes back to normal.
This behaviour can be seen in the photo below. Sorry for the image quality, I cannot take screenshots on this device.
Photo of the unexpected behaviour
I cannot really show any code examples since this happens every time the keyboard appears, from different screens with different navigation stacks.
This works fine on iOS devices and on the Android emulators I have tried, so clearly this has something to do with the device/OS I'm running this on.
Has anyone experienced this or something similar and has an idea of how to prevent this?
Upvotes: 1
Views: 447
Reputation: 86
I've found the solution. The bug is apparently related to the calculation of screen height when the Android navigation bar is hidden.
We need to manually inform Flutter that the navbar is not enabled:
await SystemChrome.setEnabledSystemUIMode(
SystemUiMode.manual,
overlays: [SystemUiOverlay.top],
);
Since this issue occurs only on PAX devices, I believe it's safe to make this call only if the manufacturer is identified as PAX.
Upvotes: 0