OneCallWeatherFactory class
This class queries the OneCall Weather API endpoint, the docs to which can be found at https://openweathermap.org/api/one-call-api
Constructors
-
OneCallWeatherFactory({required String apiKey, Language language = Language.ENGLISH, required UnitSettings settings, LocationCoords? locationCoords, List<
ExcludeField> ? exclusions, Duration maxTimeBeforeTimeout = const Duration(seconds: 3)})
Properties
- apiKey ↔ String
-
getter/setter pair
-
exclusions
↔ List<
ExcludeField> ? -
This takes an array of type ExcludeField. Any fields, such as the daily weather, the hourly weather, weather alertss
that you do not want to query, include them here by providing the corresponding
ExcludeField
enumgetter/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< OneCallWeather?> > - Public function to get the weather for a given latitude and longitude
-
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