Erreur nul en raison du retard dans la réponse de l'API
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
),
);
}
Thankful Tapir