You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As far as I know Flutter does not have API for disposing platform code on app termination. Problem is, there is no way to use onDestroy method of Activity (flutter/flutter#21982).
There is possibility to detect application life-cycle, including suspending and resuming - which potentially could be used in future 🤔 . I think it would cause onStateChanged and similar streams to be closed every time app goes suspended, so user will need to reopen the stream(s).
Further plans:
Add private function dispose or something in Android platform plugin class to be invoked,
Detect certain life-cycle states (even maybe ON_DESTROY) and call the dispose function,
Dispose whatever needs to be disposed.
Added Good First Issue since it isn't that much hard to achieve, there are my suggestion about where/how to start working on it and this is not that critical issue.
Flutter plugin registry exposes addViewDestroyListener which allows the library take a part in onDestroy of the application... I think I was blind, I did not see it...
Commit with fix landing in few minutes on develop branch, so closing for now.
Maybe there should be some 'shutdown' api to make a unregister call for the stateStreamHandler?
The text was updated successfully, but these errors were encountered: