PathItem.fromJson constructor

PathItem.fromJson(
  1. Map<String, dynamic> json
)

Creates a new PathItem instance from a JSON object.

Implementation

factory PathItem.fromJson(Map<String, dynamic> json) {
  return PathItem(
    distanceToPrevFeet:
        ((json[ApiFields.distanceToPrev] ?? -1) as num).toInt(),
    lineCode: json[ApiFields.lineCode] ?? '',
    seqNum: ((json[ApiFields.seqNum] ?? -1) as num).toInt(),
    stationCode: json[ApiFields.stationCode] ?? '',
    stationName: json[ApiFields.stationName] ?? '',
  );
}