title: Flutter: How to track app lifecycle without a widget
body: <p>I'm involved with the FlutterSound project which is shipped as a package containing an api that,  for the purposes of this question, doesn't contain a widget.</p>
  
  <p>The api needs to handle events when the application changes its state (AppLifecycleState.pause/resume). (we need to stop/resume audio when the app is paused/resumed).</p>
  
  <p>I can see how to do this in a widget using WidgetsBindingObserver but the api needs this same info without having to rely on a widget.</p>
  
  <p>The SchedulerBinding class has a method handleAppLifecycleStateChanged which seems to provide the required info but its unclear how to implement this outside of a widget.</p>