Easily make Flutter apps responsive. Automatically adapt UI to different screen sizes. Responsiveness made simple. Demo: https://gallery.codelessly.com/flutterwebsites/minimal/
Since the ResponsiveBreakpointsState is already a WidgetsBindingObserver, why don't we observe the AppLifecycleState and calculate breakpoints only when the app is in foreground?
Run the following code on iPad simulator in landscape mode:
Check the console, you should see the following output:
Press home button to go back to home screen, the breakpoint is calculated again, you can validate that by seeing the following on console:
Bring back the app, you can see the breakpoint is calculated again:
Since the
ResponsiveBreakpointsState
is already aWidgetsBindingObserver
, why don't we observe theAppLifecycleState
and calculate breakpoints only when the app is in foreground?Related to this issue.