getUserList method

  1. @override
Future<void> getUserList(
  1. int page,
  2. String search,
  3. MetaDataUserList? metaDataUserList,
  4. dynamic callback(
    1. FlyResponse response
    )?, {
  5. int perPageResultSize = 20,
})
override

This method is used to get the user list.

Implementation

@override
Future<void> getUserList(
    int page,
    String search,
    MetaDataUserList? metaDataUserList,
    Function(FlyResponse response)? callback,
    {int perPageResultSize = 20}) async {
  String? re;
  try {
    re = await mirrorFlyMethodChannel.invokeMethod("get_user_list", {
      "page": page,
      "search": search,
      "perPageResultSize": perPageResultSize,
      "metaDataUserList": metaDataUserList?.toMap()
    });
    var res = convertUsersDataJsonFromString(re);
    callback?.call(FlyResponse(true, res, "users list fetched"));
  } on PlatformException catch (e) {
    LogMessage.d("Platform Exception =", " $e");
    callback?.call(FlyResponse(false, FlyConstants.empty, FlyConstants.empty,
        FlyException(e.code, e.message, e.details)));
  } on Exception catch (e) {
    LogMessage.d("Exception ", " $e");
    callback?.call(FlyResponse(false, FlyConstants.empty, FlyConstants.empty,
        FlyException(FlyErrorCode.unHandle, FlyErrorMessage.unHandle, e)));
  }
}