I am aware that we can observe AppLifecycle state changes, but how can we query the current state?
I'd like to guard certain logic before it has observed a state change.
A little bit late, but as this was the first result on Google when I was querying the same thing, here's the answer:
WidgetsBinding.instance.lifecycleState
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With