Saturday 22 August 2020

Listen to Orientation State in Flutter; before & after rotation

OrientationBuilder reports the orientation change after the full transformation has taken place, then the rebuild occurs after that.

Is there a way to act before the orientation initiates? I am not trying to pre-empt the rotation, but make changes simutaneously, not after.

The goal:

  1. Device is rotated.
  2. Detect this and rebuild UI to show overlay.
  3. Flutter performs its own tranformation, rotating UI to new orientation.
  4. After fixed time period simply rebuild to hide overlay.

The challenge, how to fulfil point 2 before 3 occurs?



from Listen to Orientation State in Flutter; before & after rotation

No comments:

Post a Comment