added comments and refactored code
This commit is contained in:
@@ -9,6 +9,7 @@ class Api {
|
||||
static const String _rootUrl =
|
||||
'https://environment.data.gov.uk/flood-monitoring';
|
||||
|
||||
/// Fetches all stationszt
|
||||
static Future<List<FloodStation>> fetchAllStations() async {
|
||||
List<FloodStation> stations = [];
|
||||
final response = await http.get(Uri.parse('$_rootUrl/id/stations'));
|
||||
@@ -37,7 +38,6 @@ class Api {
|
||||
|
||||
/// [limit] limits the number of entries that are requested from the API and [offset] returns the
|
||||
/// list starting from the specified number
|
||||
|
||||
static Future<List<FloodStation>> fetchStationsByRange(
|
||||
int limit, int offset) async {
|
||||
List<FloodStation> stations = [];
|
||||
@@ -52,6 +52,7 @@ class Api {
|
||||
return stations;
|
||||
}
|
||||
|
||||
/// Fetches all readings from the station with the specified [stationId] from the last 24h
|
||||
static Future<List<Reading>> fetchReadingsFromStation(
|
||||
String stationId) async {
|
||||
List<Reading> readings = [];
|
||||
|
||||
Reference in New Issue
Block a user