Add LeakNavigatorObserver to navigatorObservers in MaterialApp , it will automatically detect whether there is a memory leak in the page’s Widget and its corresponding Element object. If page’s Widget is a StatefulWidget , it will also be automatically checked Its corresponding State .
Read moreWhat causes memory leaks in Flutter?
Once the object is referenced long-term by other objects due to reasons, such as circular reference, GC will not be able to release it . This will eventually lead to a memory leak. Let’s discuss this problem in Flutter. Flutter is a rendering engine.11 May 2021
Read moreHow do you profile on Flutter app?
Launch the app in profile mode as follows:
Read more