title: How to execute code before app exit flutter
body: <p>I want to detect when a user quit my app and execute some code before but I don't know how to do this. I tried to use this package: <a href="https://pub.dev/packages/flutter_lifecycle_state" rel="noreferrer">https://pub.dev/packages/flutter_lifecycle_state</a> but I have this error: </p>
  
  <blockquote>
    <p>flutter/.pub-cache/hosted/pub.dartlang.org/flutter_lifecycle_state-1.0.0/lib/flutter_lifecycle_state.dart:80:30: Error: Getter not found: 'suspending'.
          case AppLifecycleState.suspending</p>
  </blockquote>
  
  <p>If you have any solution for this problem or know another way to detect when a user quit my app it could be cool </p>