Browse Source

remove observer on dispose

Neeraj Gupta 3 years ago
parent
commit
5b34968f50
1 changed files with 6 additions and 0 deletions
  1. 6 0
      lib/app.dart

+ 6 - 0
lib/app.dart

@@ -86,6 +86,12 @@ class _EnteAppState extends State<EnteApp> with WidgetsBindingObserver {
     );
   }
 
+  @override
+  void dispose() {
+    WidgetsBinding.instance.removeObserver(this);
+    super.dispose();
+  }
+
   @override
   void didChangeAppLifecycleState(AppLifecycleState state) {
     if (state == AppLifecycleState.resumed) {