'App not returned to portrait mode in full screen mode

I'm trying to put an App in full screen mode, but when I return to portrait mode, the full screen mode continues

Widget build(BuildContext context) {
    MediaQuery.of(context).orientation == Orientation.landscape
    ? SystemChrome.setEnabledSystemUIMode(SystemUiMode.immersiveSticky)
    : null;
}


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source