fetchNextTrains function
Fetches the next trains for the given station codes.
apiKey
is your API key for the WMATA API.
If stationCodes
is null
, then all stations will be returned.
Implementation
Future<List<NextTrain>> fetchNextTrains(
String apiKey, {
List<String>? stationCodes,
}) async =>
NextTrainsService.fetchNextTrains(
apiKey,
stationCodes: stationCodes == null ? 'All' : stationCodes.join(','),
);