Flutter Rust Bridge State When Flutter App Lifecycle is Detached #2361
Answered
by
fzyzcjy
szczygielmr
asked this question in
Q&A
-
What happens to Flutter Rust Bridge (FRB) when a Flutter app's lifecycle becomes detached? Is the FRB still executing in the background? If so when the Flutter app is in a resumed state, how can I get a handle to the executing FRB? |
Beta Was this translation helpful? Give feedback.
Answered by
fzyzcjy
Oct 22, 2024
Replies: 1 comment 2 replies
-
May I know what do you mean by "executing"? frb is just a "bridge" to allow Rust and Dart/Flutter communicate easily. Thus the answer is same as if you have some vanilla Rust (or C or C++) code and vanilla Dart code. For example, suppose the whole app process is killed, then both Dart and Rust code will stop. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
So, do you want to make it run for e.g. when user completely exit your app? Then I guess you need to find some doc about underlying platform, or better, some Rust/Dart wrappers. IIRC e.g. Android allows some background service to be long living even if user exits the app, as long as you follow their doc to setup it.
If the Flutter app is not exited, then the state in Flutter is still there, thus just do everything normally imho.