title: How do you run a task in the background in flutter?
body: <p>I have a Kotlin function that will take a while, and will then return a result (It downloads and parses a file).</p>
  
  <p>I run it from Flutter like this:</p>
  
  <pre><code>void click() {
    platform.invokeMethod('runMyLongFunc').then((a) {
      print("Done");
      setState(() {});
    });
  }
  </code></pre>
  
  <p>What should I do for this to run in a background thread (as of now it's blocking on the UI thread).</p>
  
  <p>I tried making click async and it didn't help (<code>void click() async</code>).</p>