Is there any code to detect if user pressed home / tab ? i want make my music pause when it pressed
Asked
Active
Viewed 2,259 times
1 Answers
4
To track lifecycle events by adding an observer to WidgetsBinding
and then pause the music when the app pauses.
You can take look at this example. For all the lifecycle states look into AppLifecycleState
.
Hope that helped!

Hemanth Raj
- 32,555
- 10
- 92
- 82