-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
state management in foreground service isolate #5
Comments
First of all I broke my arm so it will take time for me to fix something Second, in flutter to send data between the android OS and the dart code you need to work with channels which works over an engine. When the app is starts there is a main engine that created with it, but to make the task work when the flutter app is closed I need to create a different engine which isn't communicate with the main engine. In the end it means that you need to treat the task function like another flutter app, you need to initialize everything again in the task function Which means that what you want me to do isn't possible I hope that it makes sense and sorry for bad English |
i think, you should add startTaskFunctionJustForOnce |
You mean creating a task that will be executed only once, and it will execute different code then the periodic task? |
pls check https://pub.dev/packages/workmanager it supports: |
but the plugins purpose is different In the My plugin purpose is to create a non stop running foreground service and if I implement an option to execute multiple tasks so it's like creating the built in If you want me to add button action or custom foreground layout etc I can add those because I do see this as something that my plugin should do btw |
But it has to be a task function runs only once option. For example i have a function. its calculating finish time is 2 minutes and it has backend operations. i want to run it only ones with foreground servise. How can i make this? |
I see. You can now create a periodic task and kill it after it executed |
I'm in a dilemma I don't know if to create the tasks like so: what do you say? |
how can i send a state to foreground service and get same state from it? May be you can update your plugin about it.
Please check it: fluttercommunity/get_it#145
and i made an example for this problem: https://github.com/yakupbaser/demogetit
The text was updated successfully, but these errors were encountered: