getAll static method
Future<List<User>>
getAll(
- KuebikoHttpClient httpClient,
- CacheController cacheController
)
Implementation
static Future<List<User>> getAll(KuebikoHttpClient httpClient, CacheController cacheController) async {
Uri uri = httpClient.config.generateApiUri('/users');
http.Response res = await httpClient.get(uri);
Map json = jsonDecode(res.body);
List usersRaw = json['users'];
return usersRaw.map((user) => User(
user['id'],
user['name'],
user['email'],
user['role'].cast<String>(),
httpClient,
cacheController
)).toList();
}