getForecastWeatherByLocation method

Future<ForecastWeather> getForecastWeatherByLocation(
  1. double latitude,
  2. double longitude, {
  3. int forecastDays = 1,
  4. bool airQualityIndex = false,
  5. bool alerts = false,
})

Fetch Forecast API data by location.

Implementation

Future<ForecastWeather> getForecastWeatherByLocation(
    double latitude, double longitude,
    {int forecastDays = 1,
    bool airQualityIndex = false,
    bool alerts = false}) async {
  Map<String, dynamic>? jsonResponse =
      await _sendRequest<Map<String, dynamic>>(APIType.forecast,
          latitude: latitude,
          longitude: longitude,
          forecastDays: forecastDays,
          airQualityIndex: airQualityIndex,
          alerts: alerts);

  return ForecastWeather(jsonResponse!);
}