I am looking for a way of listening for changes to the phones orientation, with the intent to hide something if the phone is Landscape.
My Layout is currently only displayed in portrait, as intended, but I want my app to do something if the device is rotated to Landscape, while keeping the layout in Portrait.
I have tried using a OrientationBuilder
, but this only works if the layout changes to Landscape.
I have also tried using MediaQuery.of(context).orientation
, but it continues to return portrait once the device is rotated, again only using the layouts orientation.