Warning class Weather

Weather warning (hazard) active at a given location.

Warnings are returned by the current weather request (see WeatherService.getCurrent) and by the route forecast request (see WeatherService.getForecast); hourly / daily forecast requests never carry them.

Note: the current weather request filters warnings only by expiry, so a returned warning's onset may still be in the future - check startStamp when only currently active warnings are wanted. The route forecast applies both bounds against each route point ETA.

Constructors

Warning({required String type, required String name, required String severity, required String phenomenon, required String description, required String area, DateTime? startStamp, DateTime? endStamp, required Color color, List<Marker> coverage = const <Marker>[], SeverityLevel severityLevel = SeverityLevel.unknown, int severityRank = 0})
Creates a Warning instance.

Properties

area ↔ String
Area / region name from the provider.
getter/setter pair
color ↔ Color
Warning color.
getter/setter pair
coverage ↔ List<Marker>
Coverage polygons; populated only when the warnings coverage geometry was requested (CoverageGeometry.polygons).
getter/setter pair
description ↔ String
Provider description text (source language, as sent by the weather provider).
getter/setter pair
endStamp ↔ DateTime?
Warning validity interval end (UTC); null if not provided.
getter/setter pair
hashCode → int
The hash code for this object.
no setterinherited
name ↔ String
Display name translated according to current language (hazard text with the severity word substituted).
getter/setter pair
phenomenon ↔ String
Provider phenomenon text (source language, as sent by the weather provider).
getter/setter pair
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
severity ↔ String
Severity word; translated according to current language when the severity code is known by the local weather resource, otherwise the server provided wording (English).
getter/setter pair
severityLevel ↔ SeverityLevel
CAP display bucket (see SeverityLevel), derived from severityRank ~/ 100. For labels / grouping; sort on severityRank instead. Stamped by the weather producer from the same classification that sets color, so level and colour never disagree.
getter/setter pair
severityRank ↔ int
Composite cross-provider ordering key from the producer: severity bucket * 100 + hazard class (0..514). Sort DESCENDING on this single field when several warnings overlap - the severity bucket (severityRank ~/ 100, 0..5) dominates, the hazard class (severityRank % 100, 0..14) breaks same-severity ties (e.g. flood before heat). 0 = unresolved severity (sorts last, still shown).
getter/setter pair
startStamp ↔ DateTime?
Warning validity interval start (UTC); null if not provided.
getter/setter pair
type ↔ String
Encoded warning code <HAZARD>.<SEVERITY>, e.g. SEHR.V.
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