flutter_workmanager
                                
                                
                                
                                    flutter_workmanager copied to clipboard
                            
                            
                            
                        Work manager task cancellation listener
I have added the Network policy in the work manager. When a worker is running, I am updating the UI to a loading state in the callback dispatcher. But when the internet is gone, the task is automatically canceled, with no callback. Any idea what can I do?
In the WorkManager docs, we can see for onStopped:
This method is invoked when this Worker has been told to stop. At this point, the ListenableFuture returned by the instance of startWork() is also cancelled. This could happen due to an explicit cancellation signal by the user, or because the system has decided to preempt the task. In these cases, the results of the work will be ignored by WorkManager. All processing in this method should be lightweight - there are no contractual guarantees about which thread will invoke this call, so this should not be a long-running or blocking operation.
This should be the signal to bring back to the UI. I will look how to make it available on the Dart side.
any updates??
any updates?