Flutter/Dart - calling a function that is a Future … but needs to return only a String

后端 未结 2 1830
醉酒成梦
醉酒成梦 2021-01-25 16:40

I have an async function that is calling out to Firestore to pull in a data value. I got a lot of help in a previous post...learned a lot...and wanted to start over with hopeful

2条回答
  •  清酒与你
    2021-01-25 17:27

    you can't use await in a function that is not async, which means the use

    var setList = await getSetList();
    

    in your build function is wrong.

提交回复
热议问题