CurrentWeather class
This is the class that handles JSON deserialization and makes data for CurrentWeather queries accessible. The fields in this class differ slightly to OneCallCurrentWeather as the API provides different fields when querying the One Call API Endpoint and the Current Weather API endpoint.
Constructors
- CurrentWeather({String? cityName, String? countryCode, LocationCoords? locationCoords, int? weatherID, String? iconID, WeatherType? weatherType, String? mainDescription, String? secondaryDescription, num? temp, num? feelsLike, num? minTemp, num? maxTemp, num? visibility, num? humidity, num? cloudiness, num? pressure, num? pressureGroundLevel, num? pressureSeaLevel, num? windSpeed, int? windDegree, num? windGustSpeed, num? rainAmountLast1h, num? rainAmountLast3h, num? snowAmountLast1h, num? snowAmountLast3h, DateTime? sunrise, DateTime? sunset, DateTime? timeStamp, int? timezoneOffset})
-
CurrentWeather.fromJson(Map<
String, dynamic> json, UnitSettings settings) -
JSON deserialization constructor
factory
Properties
- cityName ↔ String?
-
The name of the city for which the weather was queried
getter/setter pair
- cloudiness ↔ num?
-
The cloudiness, in percentage
getter/setter pair
- countryCode ↔ String?
-
The country code of the city for which the weather was queried
getter/setter pair
- feelsLike ↔ num?
-
The current temperature, accounting for human perception, in Celsius by default
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- humidity ↔ num?
-
The humidity, in percentage
getter/setter pair
- iconID ↔ String?
-
The icon ID provided by OpenWeather. The table for what the values represent can be found at
https://openweathermap.org/weather-conditions . I do not recommend you use this directly.
Instead, use the weatherType parameter, which is extrapolated from both this and the id
sent by OpenWeather for a specific request
getter/setter pair
- locationCoords ↔ LocationCoords?
-
The longitude and latitude for the city for which the weather was queried
getter/setter pair
- mainDescription ↔ String?
-
This is the main, concise description for the current weather
getter/setter pair
- maxTemp ↔ num?
-
The maximum temperature for that area for that moment, in Celsius by default
getter/setter pair
- minTemp ↔ num?
-
The minimum temperature for that area for that moment, in Celsius by default
getter/setter pair
- pressure ↔ num?
-
The atmospheric pressure, in hecto-pascals by default
getter/setter pair
- pressureGroundLevel ↔ num?
-
The atmospheric pressure at ground level, in hecto-pascals by default
getter/setter pair
- pressureSeaLevel ↔ num?
-
The atmospheric pressure at sea level, in hecto-pascals by default
getter/setter pair
- rainAmountLast1h ↔ num?
-
The amount of rainfall in the past 1 hour, in mm by default
getter/setter pair
- rainAmountLast3h ↔ num?
-
The amount of snowfall in the past 1 hour, in mm by default
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- secondaryDescription ↔ String?
-
This is the secondary, longer description for the current weather
getter/setter pair
- snowAmountLast1h ↔ num?
-
The amount of rainfall in the past 3 hours, in mm by default
getter/setter pair
- snowAmountLast3h ↔ num?
-
The amount of snowfall in the past 3 hours, in mm by default
getter/setter pair
- sunrise ↔ DateTime?
-
The time of sunrise for that day, in UTC time
getter/setter pair
- sunset ↔ DateTime?
-
The time of sunset for that day, in UTC time
getter/setter pair
- temp ↔ num?
-
The current temperature, in Celsius by default
getter/setter pair
- timeStamp ↔ DateTime?
-
The timestamp of when the data was requested, in UTC time
getter/setter pair
- timezoneOffset ↔ int?
-
The timezone offset from UTC time of the location for which the weather was queried, in seconds
getter/setter pair
- visibility ↔ num?
-
The visibility for that area for that moment, in Kilometres by default
getter/setter pair
- weatherID ↔ int?
-
The condition ID provided by OpenWeather. The table for what the values represent can be found at
https://openweathermap.org/weather-conditions . I do not recommend you use this directly.
Instead, use the weatherType parameter, which is extrapolated from both this and the icon string
sent by OpenWeather for a specific request
getter/setter pair
- weatherType ↔ WeatherType?
-
The enum for identifying what the weather condition is. The main description parameter provides one suitable
for display, so this is primarily provided to aid in implementing conditional logic dependent on the weather,
for example, a dynamic background. It is based on the ID and icon string sent by OpenWeather for a specific
request. I recommend you use this isntead of weatherID or iconID
getter/setter pair
- windDegree ↔ int?
-
The direction of the wind, in degrees
getter/setter pair
- windGustSpeed ↔ num?
-
The wind gust speed, in km/h by default
getter/setter pair
- windSpeed ↔ num?
-
The wind speed, in km/h by default
getter/setter pair
Methods
-
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