Flutter: SystemChrome.setEnabledSystemUIOverlays visual bug upon enabling SystemUiOverlay.bottom

503 Views Asked by At

so i am experiencing a visual bug upon enabling SystemUiOverlay.bottom if the keyboard is currently animating in or out, like seen in the code below. So what i am intending is for the bottom navigation bar to only ever be enabled while the virtual keyboard is active.

Also i am using the package https://pub.dev/packages/keyboard_visibility

KeyboardVisibilityNotification().addNewListener(
      onChange: (bool visible) {
        if (visible == false) {
          SystemChrome.setEnabledSystemUIOverlays([]);
        } else {
          SystemChrome.setEnabledSystemUIOverlays([SystemUiOverlay.bottom]);
        }
      },
    );

The problem is the scaffold of my app and everything in it seems to jump vertically then quickly return to its original position, Creating this off putting transition between the two virtual keyboard states.

This only seems to occur if i enable the SystemUiOverlay.bottom while the virtual keyboard is transitioning between enabled and disabled states. If i enable it before or after, no visual bug occurs.

Thanks.

0

There are 0 best solutions below