Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I have issue in getlocationData() method using Navigator.push of LocationScreen(); #36

Open
Midhunap opened this issue Nov 18, 2022 · 0 comments

Comments

@Midhunap
Copy link

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();
  
}));

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant