fetchStation static method
Implementation
static Future<Station> fetchStation(
String apiKey, {
required String stationCode,
}) async {
final String host = _buildSingleStationUrl(
stationCode: stationCode,
);
final response = await http.get(
Uri.parse(host),
headers: {"api_key": apiKey},
);
Map<String, dynamic> responseArr = readJson(response.body);
if (responseArr.isEmpty) return Station.empty();
return Station.fromJson(responseArr);
}