getRealtimeWeatherByLocation method

Future<RealtimeWeather> getRealtimeWeatherByLocation(
  1. double latitude,
  2. double longitude, {
  3. bool airQualityIndex = false,
})

Fetch Realtime API data by location.

Implementation

Future<RealtimeWeather> getRealtimeWeatherByLocation(
    double latitude, double longitude,
    {bool airQualityIndex = false}) async {
  Map<String, dynamic>? jsonResponse =
      await _sendRequest<Map<String, dynamic>>(APIType.realtime,
          latitude: latitude,
          longitude: longitude,
          airQualityIndex: airQualityIndex);

  return RealtimeWeather(jsonResponse!);
}