currentWeatherByCityName method

Future<Weather> currentWeatherByCityName(
  1. String cityName
)

Fetch current weather based on city name Result is JSON. For API documentation, see: https://openweathermap.org/current

Implementation

Future<Weather> currentWeatherByCityName(String cityName) async {
  Map<String, dynamic>? jsonResponse =
      await _sendRequest(CURRENT_WEATHER, cityName: cityName);
  return Weather(jsonResponse!);
}