@ -5,46 +5,46 @@ part 'construction_report.g.dart';
@ JsonSerializable ( createToJson: false )
class ConstructionReport {
final String id ;
@ JsonKey ( name: " nr " , fromJson: int . parse )
@ JsonKey ( name: ' nr ' , fromJson: int . parse )
final int index ;
@ JsonKey ( name: " termin " , fromJson: _parseListOrString )
@ JsonKey ( name: ' termin ' , fromJson: _parseListOrString )
final List < String > timePeriodTexts ;
@ JsonKey ( name: " termin_pins " , fromJson: _parseListOrString )
@ JsonKey ( name: ' termin_pins ' , fromJson: _parseListOrString )
final List < String > timePeriodPinsTexts ;
@ JsonKey ( name: " termin_zeit " , fromJson: _parseListOrString )
@ JsonKey ( name: ' termin_zeit ' , fromJson: _parseListOrString )
final List < String > timePeriodTimeTexts ;
final String headline ;
final String headlinePins ;
@ JsonKey ( name: " meldung " , fromJson: _parseListOrString )
@ JsonKey ( name: ' meldung ' , fromJson: _parseListOrString )
final List < String > messages ;
@ JsonKey ( name: " meldung_pins " , fromJson: _parseListOrString )
@ JsonKey ( name: ' meldung_pins ' , fromJson: _parseListOrString )
final List < String > messagesPins ;
@ JsonKey ( name: " meldung_hinweis " , fromJson: _parseListOrString )
@ JsonKey ( name: ' meldung_hinweis ' , fromJson: _parseListOrString )
final List < String > messagesHint ;
@ JsonKey ( name: " hinweis_tabelle " , fromJson: _parseListOrString )
@ JsonKey ( name: ' hinweis_tabelle ' , fromJson: _parseListOrString )
final List < String > hintTable ;
@ JsonKey ( name: " grund " )
@ JsonKey ( name: ' grund ' )
final String reason ;
@ JsonKey ( name: " abschnitt " )
@ JsonKey ( name: ' abschnitt ' )
final List < String > affectedStations ;
final DateTime lastChange ;
@ JsonKey ( name: " ics " )
@ JsonKey ( name: ' ics ' )
final String icsUrl ;
@ JsonKey ( name: " termine " , fromJson: _parseTimeRanges )
@ JsonKey ( name: ' termine ' , fromJson: _parseTimeRanges )
final List < TimeRange > timeRanges ;
@ JsonKey ( name: " von " )
@ JsonKey ( name: ' von ' )
final DateTime startDate ;
@ JsonKey ( name: " bis " )
@ JsonKey ( name: ' bis ' )
final DateTime endDate ;
ConstructionReport (
@ -97,11 +97,11 @@ class TimeRange {
const TimeRange ( { this . begin , this . end , this . allDay , this . weekdays } ) ;
TimeRange . _fromJson ( Map < String , dynamic > json )
: begin = _parseTimeStamp ( json , " von " ) ,
end = _parseTimeStamp ( json , " bis " ) ,
allDay = json [ " ganztaegig " ] = = " 1 " ,
weekdays = json [ " wochentage " ] is List
? ( json [ " wochentage " ] as List < dynamic > )
: begin = _parseTimeStamp ( json , ' von ' ) ,
end = _parseTimeStamp ( json , ' bis ' ) ,
allDay = json [ ' ganztaegig ' ] = = ' 1 ' ,
weekdays = json [ ' wochentage ' ] is List
? ( json [ ' wochentage ' ] as List < dynamic > )
. map ( ( day ) = > int . parse ( day ) )
. toList ( )
: null ;