Line.fromJson constructor
Creates a new Line from a JSON object.
Implementation
factory Line.fromJson(Map<String, dynamic> json) {
return Line(
name: json[ApiFields.displayName] ?? '',
startStationCode: json[ApiFields.startStationCode] ?? '',
endStationCode: json[ApiFields.endStationCode] ?? '',
internalDestination1: json[ApiFields.internalDestination1] ?? '',
internalDestination2: json[ApiFields.internalDestination2] ?? '',
lineCode: json[ApiFields.lineCode] ?? '',
);
}