📅  最后修改于: 2022-03-11 14:48:03.047000             🧑  作者: Mango
String text;
fetchData() async {
//...
text = weatherData.weather[0].main ?? 'Waiting api response...';
//...
}
// in your build method
@override
Widget build(BuildContext context) {
return Scaffold(
body: Container(
child: Text(text), //this will render "Waiting api response" first, and when the api result arrive, it will change
),
);
}