getUsers method

Future<List<UserModel>> getUsers()

Retrieve all users from the database.

Implementation

Future<List<UserModel>> getUsers() async {
  final retrieveUserlist = instance.httpsCallable('retrieveUserlist');
  final HttpsCallableResult<dynamic> userList = await retrieveUserlist();
  final List<dynamic> usersJson = userList.data as List<dynamic>;
  return usersJson
      .map((json) => UserModel.fromJson(prepareJson(json as Map)))
      .toList();
}