PTAlertInfo constructor

PTAlertInfo({
  1. required PTAlertCause cause,
  2. required PTAlertEffect effect,
  3. required List<PTAlertActivePeriod> activePeriods,
  4. required List<PTAlertTranslation> urls,
  5. required List<PTAlertTranslation> headerTexts,
  6. required List<PTAlertTranslation> descriptionTexts,
  7. PTAlertSeverityLevel? severityLevel,
  8. List<PTAlertTranslation> causeDetails = const <PTAlertTranslation>[],
  9. List<PTAlertTranslation> effectDetails = const <PTAlertTranslation>[],
})

Create a PTAlertInfo.

API users do not typically create instances of this class directly. Get instances from PTStopInfo.alerts, PTTrip.alerts or PTStop.alerts.

Parameters

  • cause: (PTAlertCause) The cause of the alert.
  • effect: (PTAlertEffect) The effect of the alert.
  • activePeriods: (List<PTAlertActivePeriod>) Periods when the alert is active.
  • urls: (List<PTAlertTranslation>) URL translations for more information.
  • headerTexts: (List<PTAlertTranslation>) Header text translations.
  • descriptionTexts: (List<PTAlertTranslation>) Description text translations.
  • severityLevel: (PTAlertSeverityLevel?) The severity of the alert.
  • causeDetails: (List<PTAlertTranslation>) Agency-specific cause wording translations.
  • effectDetails: (List<PTAlertTranslation>) Agency-specific effect wording translations.

Implementation

PTAlertInfo({
  required this.cause,
  required this.effect,
  required this.activePeriods,
  required this.urls,
  required this.headerTexts,
  required this.descriptionTexts,
  this.severityLevel,
  this.causeDetails = const <PTAlertTranslation>[],
  this.effectDetails = const <PTAlertTranslation>[],
});