I've got a flutter app which I'm working on which includes a calendar.
When updating each day on the calendar needs to do some processing to work out what to display.

Everything was working fine until the amount of data got a little higher.
Now the updating function is blocking the UI while every single day is updated.

I attempted to do the updating and show a progress animation while it is updating.

I though that if I ran the code in an asynchronous function and then updated the state with the processed data it would prevent this blocking action.
I'm calling the update function from the initState function of my Day display (A stateful widget).
A also looked into using this threading library;
but it's not compatyable with the current beta branch of Flutter.

I'm aware there is an IO thread which I think would be the correct place for this operation to be processed, but I can't see how to run Dart code on it.

What is the correct way to run heavy operations without blocking the UI?

Here's an example of the code I've tried for my day display widget;

class DayDisplay extends StatefulWidget{
  DayDisplay(this.date, {Key key}) : super(key: key);
  DateTime date;
  State<StatefulWidget> createState() => new _DayState();

class _DayState extends State<DayDisplay>{

  void initState(){
    loading = true;
    new Future(updateData);//.then(()=>updateUI());

  void updateUI(){
    if (mounted){
      setState(() {});

  void updateData() async{
    ///Do heavy processing in here to populate data
    setState(() => loading = false);

  Widget build(BuildContext context) {
    return /*{Generate widget tree here}*/;