Skip to content

Unable to print decodeData(); into the console #22

Description

@ahmloutfy

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions