fiveDaysWeatherForecastByLocation method
Future<WeatherForecastData>
fiveDaysWeatherForecastByLocation({
- required double latitude,
- required double longitude,
- Languages? language,
- WeatherUnits weatherUnits = WeatherUnits.IMPERIAL,
Implementation
Future<WeatherForecastData> fiveDaysWeatherForecastByLocation(
/// Retrieves the WeatherForecastData object by the current location
/// In order to use the function, [latitude] and [longitude] is required
/// It is possible to set the weather units by setting a specific value in [weatherUnits]
{required double latitude,
required double longitude,
final Languages? language,
WeatherUnits weatherUnits = WeatherUnits.IMPERIAL}) async {
try {
Map<String, dynamic> currentWeather = await _sendRequest('forecast',
lat: latitude,
lon: longitude,
weatherUnits: weatherUnits,
language: language);
return WeatherForecastData.fromJson(currentWeather);
} catch (err) {
rethrow;
}
}