Int is not subtype of double || This error is because of open weather API
kiranojhanp opened this issue · comments
This error is because of open weather API
Replace
double temp = weatherData['main']['temp'];
temperature = temp.toInt();
with
if (weatherData['main']['temp'].runtimeType == double) {
double temp = weatherData['main']['temp'];
temperature = temp.toInt();
} else {
temperature = weatherData['main']['temp'];
}
and it should work.
Originally posted by @kiranojhanp in #20 (comment)
Thanks a lot it worked!!
no problem