retrieveAllLocations static method

Future<List<Location>> retrieveAllLocations()

Implementation

static Future<List<Location>> retrieveAllLocations() async {
  final List<Location> locations = [];

  final res = await httpClient.get(Config.getURI('locations.json'));

  for (final location in json.decode(res.body.toString())) {
    Location l = Location.fromJson(location);
    l.hasPermission = await AuthService.hasPermission(l.accountId);
    locations.add(l);
  }

  return locations;
}