2

Good morning, I'm developing my first application in Flutter and I would like to implement a background task that every second checks if a condition meets requirement. In other words, while the user uses the application, in background there is a task that checks if the current time is in a particular range (e.g 09:42 is between 09:30 and 10.00, then ok). If yes, I want to show an Alert Dialog

I have already tried to use Isolate but I failed to do that

Thank you

1 Answers1

0

If you have any state management implemented like bloc or flutter_redux or mobX, you can have a field in your state like "bool showAlert" and have a streambuilder which will listen to your app state changes and show the alert dialog when "showAlert" property is true.

Ganapat
  • 6,984
  • 3
  • 24
  • 38