Is it possible to get the instance of an existing Isolate in Flutter after reopening the App?
Asked Answered
P

1

6

I am using dart isolates to play music in background. I want to get the instance of the isolate that I spawned earlier to stop the music after closing and re-opening the Flutter App.

Is there a way to get the instance of existing isolates after re-opening the Flutter app?

Prothalamion answered 31/1, 2019 at 9:36 Comment(0)
S
-2

An isolate does not keep running in the background when the application is not in foreground.

For currently available solutions see https://medium.com/flutter-io/executing-dart-in-the-background-with-flutter-plugins-and-geofencing-2b3e40a1a124

For

https://github.com/flutter/flutter/issues/24278 https://github.com/flutter/flutter/issues/26178

Shelli answered 31/1, 2019 at 9:52 Comment(4)
But I printed 'Hello!' in the background using Isolate! And document says I can do background work. flutter.io/docs/development/packages-and-plugins/…. I've already read the Medium example. It was too difficult to understand. I am not familiar with Kotlin and do not have a door, so I think it is hard to test properly.Prothalamion
Depends on what you mean by "background". If the app is kicked out of memory because of resource shortage than all isolates will be killed with it. If you move the app to the background this usually does not happen immediately.Spile
How do you get the instance of already running isolates ?Naomanaomi
This answer seems to be outdated by now: flutter.dev/docs/development/packages-and-plugins/…Holton

© 2022 - 2024 — McMap. All rights reserved.