title: Dart future blocking main thread
body: <p>I'm working on an app that captures and processes an image. A simplified version of the code is:</p>
  <pre><code>build() {
     return FloatingActionButton(
          onPressed: processImage,
          child: Icon(
            Icons.camera_alt,
            color: color,
          ),
        ); 
  }
  
  processImage(Camera image) async {
     await image.process();   
  }
  </code></pre>
  <p>And in another class:</p>
  <pre><code>Future&lt;image&gt; process() {
    return Future(() {
      for (int x = 0; x &lt; width; x++) {
        for (int y = 0; y &lt; height; y++) {
          //process image
        }
      }
    });
  }
  </code></pre>
  <p>But when <code>process()</code> is running, the UI freezes.</p>
  <p>Why is this happening? Isn't that function passed to Future constructor running in the background?</p>