fetchScheduleAtStop static method
Implementation
static Future<ScheduleAtStop> fetchScheduleAtStop(
String apiKey, {
required String stopId,
String? date,
}) async {
final String host = _buildUrl(
stopId: stopId,
date: date,
);
final response = await http.get(
Uri.parse(host),
headers: {"api_key": apiKey},
);
Map<String, dynamic> responseArr = readJson(response.body);
if (responseArr.isEmpty) return const ScheduleAtStop.empty();
return ScheduleAtStop.fromJson(responseArr);
}