fetchStationTimings function

Future<List<StationTimings>> fetchStationTimings(
  1. String apiKey, {
  2. String? stationCode,
})

Fetches station timing info.

apiKey is your API key for the WMATA API.

Returns opening and scheduled first/last train times based on a given stationCode. Omit the stationCode to return timing information for all stations.

Note that for stations with multiple platforms (e.g.: Metro Center, L'Enfant Plaza, etc.), a distinct call is required for each stationCode to retrieve the full set of train times at such stations.

Implementation

Future<List<StationTimings>> fetchStationTimings(
  String apiKey, {
  String? stationCode,
}) async =>
    await StationTimingsService.fetchStationTimings(
      apiKey,
      stationCode: stationCode,
    );