WeatherOneCall class
Model represents weather by One Call API request.
The One Call API provides the following weather data:
- Current weather - WeatherCurrent
- Minute forecast for 1 hour - WeatherMinutely
- Hourly forecast for 48 hours - WeatherHourly
- Daily forecast for 7 days - WeatherDaily
- National weather alerts - WeatherAlert
See more one-call-api
(!) If the list of fields current, minutely, hourly, daily, alerts is empty, then these values are null.
Constructors
-
WeatherOneCall(Map<
String, dynamic> _weatherData, {required double? latitude, required double? longitude, required String? timezone, required DateTime? timezoneOffset, required WeatherCurrent? current, required List<WeatherMinutely> ? minutely, required List<WeatherHourly> ? hourly, required List<WeatherDaily> ? daily, required List<WeatherAlert> ? alerts}) -
const
-
WeatherOneCall.fromJson(Map<
String, dynamic> jsonData) -
Creating WeatherOneCall instance from json.
factory
Properties
-
alerts
→ List<
WeatherAlert> ? -
National weather alerts data from major national weather warning systems.
final
- current → WeatherCurrent?
-
Current weather.
final
-
daily
→ List<
WeatherDaily> ? -
Daily forecast weather.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
-
hourly
→ List<
WeatherHourly> ? -
Hourly forecast weather.
final
- latitude → double?
-
Latitude of the weather observation.
final
- longitude → double?
-
Longitude of the weather observation.
final
-
minutely
→ List<
WeatherMinutely> ? -
Minute forecast weather.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- timezone → String?
-
Timezone name for the requested location.
final
- timezoneOffset → DateTime?
-
Shift in seconds from UTC.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> - The original JSON data from the API
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited