staticTransform static method

AStop staticTransform(
  1. MapRecord record
)

Implementation

static AStop staticTransform(MapRecord record) => ModelBuilder.build(
  (c) {
    switch (c('location_type') as LocationType) {
      case LocationType.stop:
        {
          return Stop(
            id: c('stop_id'),
            code: c('stop_code'),
            name: c('stop_name'),
            ttsName: c('tts_stop_name'),
            description: c('stop_desc'),
            latitude: c('stop_lat'),
            longitude: c('stop_lon'),
            zoneId: c('zone_id'),
            url: c('stop_url'),
            parentStationId: c('parent_station'),
            timezone: c('stop_timezone'),
            wheelchairBoarding: c('wheelchair_boarding'),
            levelId: c('level_id'),
            platformCode: c('platform_code'),
          );
        }
      case LocationType.station:
        {
          return Station(
            id: c('stop_id'),
            code: c('stop_code'),
            name: c('stop_name'),
            ttsName: c('tts_stop_name'),
            description: c('stop_desc'),
            latitude: c('stop_lat'),
            longitude: c('stop_lon'),
            zoneId: c('zone_id'),
            url: c('stop_url'),
            timezone: c('stop_timezone'),
            wheelchairBoarding: c('wheelchair_boarding'),
            levelId: c('level_id'),
            platformCode: c('platform_code'),
          );
        }
      case LocationType.entranceOrExit:
        {
          return EntranceOrExit(
            id: c('stop_id'),
            code: c('stop_code'),
            name: c('stop_name'),
            ttsName: c('tts_stop_name'),
            description: c('stop_desc'),
            latitude: c('stop_lat'),
            longitude: c('stop_lon'),
            zoneId: c('zone_id'),
            url: c('stop_url'),
            parentStationId: c('parent_station'),
            timezone: c('stop_timezone'),
            wheelchairBoarding: c('wheelchair_boarding'),
            levelId: c('level_id'),
            platformCode: c('platform_code'),
          );
        }
      case LocationType.generic:
        {
          return GenericNode(
            id: c('stop_id'),
            code: c('stop_code'),
            name: c('stop_name'),
            ttsName: c('tts_stop_name'),
            description: c('stop_desc'),
            latitude: c('stop_lat'),
            longitude: c('stop_lon'),
            zoneId: c('zone_id'),
            url: c('stop_url'),
            parentStationId: c('parent_station'),
            timezone: c('stop_timezone'),
            wheelchairBoarding: c('wheelchair_boarding'),
            levelId: c('level_id'),
            platformCode: c('platform_code'),
          );
        }
      case LocationType.boardingArea:
        {
          return BoardingArea(
            id: c('stop_id'),
            code: c('stop_code'),
            name: c('stop_name'),
            ttsName: c('tts_stop_name'),
            description: c('stop_desc'),
            latitude: c('stop_lat'),
            longitude: c('stop_lon'),
            zoneId: c('zone_id'),
            url: c('stop_url'),
            parentStationId: c('parent_station'),
            timezone: c('stop_timezone'),
            wheelchairBoarding: c('wheelchair_boarding'),
            levelId: c('level_id'),
            platformCode: c('platform_code'),
          );
        }
      default:
        {
          return AStop(
            id: c('stop_id'),
            code: c('stop_code'),
            name: c('stop_name'),
            ttsName: c('tts_stop_name'),
            description: c('stop_desc'),
            latitude: c('stop_lat'),
            longitude: c('stop_lon'),
            zoneId: c('zone_id'),
            url: c('stop_url'),
            parentStationId: c('parent_station'),
            timezone: c('stop_timezone'),
            wheelchairBoarding: c('wheelchair_boarding'),
            levelId: c('level_id'),
            platformCode: c('platform_code'),
            locationType: c('location_type'),
          );
        }
    }
  },
  fieldDefinitions: staticFieldDefinitions,
  record: record,
);