Skip to main content

Base Entities

Last updated: September 14, 2026 | 5 minutes read

Weather-related functionalities are organized into distinct classes, each designed to encapsulate specific weather data.

The main classes include LocationForecast, Conditions, Parameter, and Warning. This guide provides a detailed explanation of each class and its purpose.

LocationForecast​

The LocationForecast class retains data such as the forecast update datetime, the geographic location, and forecast data.

PropertyTypeDescription
updatedDateTimeForecast update datetime (UTC)
coordCoordinatesGeographic location
forecastList<Conditions>Forecast data
warningsList<Warning>Active weather warnings at the location. See Warning.
Current Weather Forecast explained
info

Warnings are only populated by the current weather request (getCurrent) and the route forecast request (getForecast). The hourly and daily forecast requests never carry warnings.

Conditions​

The Conditions class retains weather conditions for a given timestamp.

PropertyTypeDescription
typeStringFor possible values see add ref[PredefinedParameterTypeValues]
stampDateTimeDatetime for condition (UTC)
imageUint8ListImage representation as Uint8List
imgImgThe conditions image as Img
descriptionStringDescription translated according to the current SDK language
daylightDaylightDaylight condition
paramsList<Parameter>Parameter list

PredefinedParameterTypeValues​

The PredefinedParameterTypeValues class contains the common values for Parameter.type and Conditions.type.

PropertyDescriptionUnit
airQuality'AirQuality'-
dewPoint'DewPoint'°C
feelsLike'FeelsLike'°C
humidity'Humidity'%
pressure'Pressure'mb
sunRise'Sunrise'-
sunSet'Sunset'-
temperature'Temperature'°C
uv'UV'-
visibility'Visibility'km
windDirection'WindDirection'°
windSpeed'WindSpeed'km/h
temperatureLow'TemperatureLow'°C
temperatureHigh'TemperatureHigh'°C
danger

The WeatherService may return data with varying property types, depending on data availability. A response might include only a subset of the values listed above.

Parameter​

The Parameter class contains weather parameter data.

PropertyTypeDescription
typeStringFor possible values see add ref[PredefinedParameterTypeValues]
valuedoubleValue
nameStringName translated according to the current SDK language
unitStringUnit

Warning​

The Warning class describes a weather hazard active at a given location.

PropertyTypeDescription
typeStringEncoded warning code in the form <HAZARD>.<SEVERITY>, e.g. SEHR.V.
nameStringDisplay name translated according to the current SDK language. Empty when the hazard code is not known by the local weather resource - fall back to phenomenon.
severityStringSeverity word, translated when the severity code is known locally, otherwise the server wording (English).
phenomenonStringProvider phenomenon text, in the source language as sent by the weather provider.
descriptionStringProvider description text, in the source language as sent by the weather provider.
areaStringArea or region name from the provider.
startStampDateTime?Start of the warning validity interval (UTC). Null when the provider supplies none.
endStampDateTime?End of the warning validity interval (UTC). Null when the provider supplies none.
colorColorWarning color.
coverageList<Marker>Coverage polygons. Only populated when the coverage geometry was requested. See Coverage geometry.
severityLevelSeverityLevelNormalized, cross-provider severity bucket. Use it for labels and grouping. See Severity Level.
severityRankintComposite cross-provider ordering key in the range 0-514. Sort descending on it.

Severity Level​

The SeverityLevel enum is the CAP-aligned display bucket of a warning, derived from severityRank ~/ 100. It is stamped by the same classification that sets Warning.color, so the level and the color never disagree.

Enum CaseDescription
unknownSeverity could not be resolved (bucket 0). Sorts last, but is still a real warning.
minorMinor (green).
moderateModerate (yellow).
severeSevere (orange).
extremeExtreme (red and magenta).

Order overlapping warnings​

Use severityLevel for labels and grouping, and sort on severityRank when several warnings overlap. The rank is composed as severity bucket * 100 + hazard class: the bucket (0-5) dominates, and the hazard class (0-14) breaks same-severity ties, so a flood sorts ahead of a heat warning of the same severity.

final warnings = [...locationForecast.warnings]
..sort((a, b) => b.severityRank.compareTo(a.severityRank));

if (warnings.isNotEmpty) {
final mostSevere = warnings.first;
showSnackbar('${mostSevere.name} (${mostSevere.severityLevel})');
}

Draw warning coverage​

When the coverage geometry was requested, every entry in Warning.coverage is a Marker holding one polygon: part 0 is the outer ring and the following parts are the holes. Rings are closed, with the first point repeated as the last, as published by the weather provider.

Give each warning its own collection so it can be drawn in its own color:

for (final warning in locationForecast.warnings) {
if (warning.coverage.isEmpty) {
continue;
}

final collection = MarkerCollection(
markerType: MarkerType.polygon,
name: 'warning_${warning.type}',
);

for (final polygon in warning.coverage) {
collection.add(polygon);
}

mapController.preferences.markers.add(
collection,
settings: MarkerCollectionRenderSettings(polygonFillColor: warning.color),
);
}