PTAlertInfo class Maps & 3D Scenes
GTFS-RT service alert associated with public transport stop data.
Alerts are provided deduplicated in PTStopInfo.alerts. The same PTAlertInfo instance is shared between PTStopInfo.alerts and every PTTrip.alerts / PTStop.alerts list which references it. The order of the alerts is not meaningful. Alerts differing only in severityLevel or in the causeDetails / effectDetails texts are distinct entries.
WARNING: The translations (urls, headerTexts, descriptionTexts, causeDetails, effectDetails) are passed through verbatim from the GTFS-RT feed. The language tags may be inaccurate — some feeds tag the same untranslated text under multiple languages — so treat them as hints and fall back to the first entry when no exact match exists (see selectTranslation).
Also see:
- PTStopInfo.alerts — All alerts for a stop info.
- PTTrip.alerts — The alerts applicable to a specific trip.
- PTStop.alerts — The alerts scoped to a specific stop.
- PTAlert - Alert of a public transport route segment. Do not confuse with this class which provides alerts for public transport data associated with stops.
Constructors
-
PTAlertInfo({required PTAlertCause cause, required PTAlertEffect effect, required List<
PTAlertActivePeriod> activePeriods, required List<PTAlertTranslation> urls, required List<PTAlertTranslation> headerTexts, required List<PTAlertTranslation> descriptionTexts, PTAlertSeverityLevel? severityLevel, List<PTAlertTranslation> causeDetails = const <PTAlertTranslation>[], List<PTAlertTranslation> effectDetails = const <PTAlertTranslation>[]}) - Create a PTAlertInfo.
Properties
-
activePeriods
→ List<
PTAlertActivePeriod> -
Periods when the alert is active.
final
- cause → PTAlertCause
-
The cause of the alert.
final
-
causeDetails
→ List<
PTAlertTranslation> -
Agency-specific cause wording translations (may be empty).
final
-
descriptionTexts
→ List<
PTAlertTranslation> -
Description text translations detailing the alert (may be empty).
final
- effect → PTAlertEffect
-
The effect of the alert.
final
-
effectDetails
→ List<
PTAlertTranslation> -
Agency-specific effect wording translations (may be empty).
final
- hashCode → int
-
The hash code for this object.
no setterinherited
-
headerTexts
→ List<
PTAlertTranslation> -
Header text translations summarizing the alert (may be empty).
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- severityLevel → PTAlertSeverityLevel?
-
The severity of the alert; null when the feed supplies none.
final
-
urls
→ List<
PTAlertTranslation> -
URL translations pointing to additional information (may be empty).
final
Methods
-
causeDetailFor(
String language) → String? -
The cause detail text for
language(see selectTranslation), or null when causeDetails is empty. -
descriptionTextFor(
String language) → String? -
The description text for
language(see selectTranslation), or null when descriptionTexts is empty. -
effectDetailFor(
String language) → String? -
The effect detail text for
language(see selectTranslation), or null when effectDetails is empty. -
headerTextFor(
String language) → String? -
The header text for
language(see selectTranslation), or null when headerTexts is empty. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
urlFor(
String language) → String? -
The URL text for
language(see selectTranslation), or null when urls is empty.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
selectTranslation(
List< PTAlertTranslation> translations, String language) → PTAlertTranslation? -
Select the best translation from
translationsforlanguage.