CurrentWeatherFactory class

This class queries the Current Weather API endpoint, the docs to which can be found at https://openweathermap.org/current

Constructors

CurrentWeatherFactory({required String apiKey, Language language = Language.ENGLISH, required UnitSettings settings, LocationCoords? locationCoords, String? cityName, Duration maxTimeBeforeTimeout = const Duration(seconds: 3)})

Properties

apiKey String
getter/setter pair
cityName String?
Used when you want to obtain the weather using a city name instead of longitude and latitude IMPORTANT: In some rare cases, two different cities from different parts of the world may have the same name. In this case, it is unpredictable which city's forecast you may receive. If you happen to successfully receive results but find on checking them that they are wildly different from what they should be (and have through sheer frustration reached all the way here, in which case, Hi!) consider doing the same query with equivalent longitude and latitude values and see if the problem persists.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
language Language
The language defaults to English
getter/setter pair
locationCoords LocationCoords?
The instance of LocationCoords that must be provided if you want to obtain the weather using longitude and latitude
getter/setter pair
maxTimeBeforeTimeout Duration
This is the maximum amount of time that the factory waits for a request to the server to complete, before retrying or returning an error
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
settings UnitSettings
The unit settings determine the data from the server is converted to
getter/setter pair

Methods

getWeather() Future<RequestResponse<CurrentWeather?>>
Public function to get the weather for a given saved city
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited