getUsersByFullName method

Future<List<QBUser?>> getUsersByFullName(
  1. String fullName, {
  2. int page = 1,
  3. int perPage = 100,
})

Implementation

Future<List<QBUser?>> getUsersByFullName(String fullName, {int page = 1, int perPage = 100}) async {
  Map<String, Object> data = Map();

  data["fullName"] = fullName;
  data["page"] = page;
  data["perPage"] = perPage;

  Map<Object?, Object?> map = await _usersModule.invokeMethod(GET_METHOD_BY_FULL_NAME, data);

  List<Object?> list = map["users"] as List<Object?>;

  List<QBUser?> userList = [];

  for (final item in list) {
    QBUser? qbUser = QBUserMapper.mapToQBUser(item as Map<dynamic, dynamic>);
    userList.add(qbUser);
  }

  return userList;
}