title: How to run code in the background of a Flutter app?
body: <p>I am working on a flutter app. I have a bunch of times of the day and I want to show an alert notification whenever a time comes and also change the UI of the app if it's running.</p>
  
  <p>So I looked for what options I have, I found the followings</p>
  
  <ul>
  <li>Plugins like <strong>flutter-workmanager</strong> and <strong>background_fetch</strong></li>
  <li>Native code implementation with Channels</li>
  </ul>
  
  <p>MY questions are:</p>
  
  <ol>
  <li>Which option is the best for my use case?</li>
  <li>Is it better implementing a time counter with delay by duration or using an alarm manager.</li>
  <li>How can I pass the data (the current time that comes) between the background task and my app so that I can update the UI?</li>
  </ol>
  
  <p>PS: Currently We are interested in a solution that works at least for Android. </p>