Unable to print decodeData(); into the console
ahmloutfy opened this issue · 3 comments
Hello!
the print lines in the following part of "loading_screen.dart" code unable to be printed:
` void getData() async {
http.Response response = await http.get(
'https://api.openweathermap.org/data/2.5/onecall?lat=$latitude&lon=$longitude&appid=$apiKey');
if (response.statusCode == 200) {
Map decodeData = json.decode(response.body);
double temperature = decodeData['main']['temp'];
int conditionNumber = decodeData['weather'][0]['id'];
String cityName = decodeData['name'];
print(temperature);
print(conditionNumber);
print(cityName);
} else {
print(response.statusCode);
}
}`
Sometimes nothing printed into the console and sometimes the problem appeared.
Also the following lines appeared:
"W/ppbrewery.clim(25370): Accessing hidden method Landroid/content/Context;->getFeatureId()Ljava/lang/String; (greylist, reflection, allowed)"
Hope the problem can be solved
Thanks
@angelabauer Hi, Can you take a look at this problem?
i have the same problem if any one know the solution let me know.
The error resolved by running the application on real / physical devices because emulator or simulator has the problem of getting real time location as per my knowledge and understanding after working for three days on this issue.