//use in an async function var string = await futureString; // or this String? valueOfFuture = null; futureFunction.then((String result){ setState(() { valueOfFuture = result; }); });