Explorar el Código

remove observer on dispose

Neeraj Gupta hace 3 años
padre
commit
5b34968f50
Se han modificado 1 ficheros con 6 adiciones y 0 borrados
  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) {