simple view of town names
This commit is contained in:
@@ -7,7 +7,7 @@ class Api {
|
||||
static const String _rootUrl =
|
||||
'https://environment.data.gov.uk/flood-monitoring';
|
||||
|
||||
static Future<void> fetchStations() async {
|
||||
static Future<List<FloodStation>> fetchStations() async {
|
||||
List<FloodStation> stations = [];
|
||||
final response = await http.get(Uri.parse('$_rootUrl/id/stations'));
|
||||
if (response.statusCode == 200) {
|
||||
@@ -16,5 +16,6 @@ class Api {
|
||||
stations.add(FloodStation.fromMap(str));
|
||||
}
|
||||
}
|
||||
return stations;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user