-
I have some resources such as databases on the Rust side. When Dart VM gets shut down, perhaps because the user closed the Flutter app, the Rust finalizer functions that destroy Rust resources should be run. Is this possible with |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
If there a way to do some actions/lifecycle-hooks when the user closes the flutter application then you can just call your rust function from there, I do not see any reason why that wouldn't work. |
Beta Was this translation helpful? Give feedback.
-
I see, that would be the reasonable way to do handle shutdown. Thank you :) |
Beta Was this translation helpful? Give feedback.
-
Unfortunately, Flutter's lifecycle hooks only work on mobile platforms and not on the desktop. I've been testing lifecycle hooks on desktop platforms, and they don't do anything related to
|
Beta Was this translation helpful? Give feedback.
If there a way to do some actions/lifecycle-hooks when the user closes the flutter application then you can just call your rust function from there, I do not see any reason why that wouldn't work.