Open Midhunap opened 1 year ago
while using Navigator.push of loadingScreen
Error :'Do not use BuildContext of async gaps'
void getLocationData() async { Location location = Location(); await location.getCurrentLocation(); longitude = location.longitude; latitude = location.latitude;
NetworkHelper networkHelper = NetworkHelper( 'https://api.openweathermap.org/data/2.5/weather?lat=$latitude&lon=$longitude&appid=$apiKey'); var weatherData = await networkHelper.getData(); Navigator.push(context, MaterialPageRoute(builder: (context){ return LocationScreen(); }));
}
while using Navigator.push of loadingScreen
Error :'Do not use BuildContext of async gaps'
void getLocationData() async { Location location = Location(); await location.getCurrentLocation(); longitude = location.longitude; latitude = location.latitude;
}