getPagingData method

Future<PageListData<List<AmityCommunity>, String>> getPagingData({
  1. String? token,
  2. int? limit,
})

Implementation

Future<PageListData<List<AmityCommunity>, String>> getPagingData(
    {String? token, int? limit}) async {
  GetCommunityRequest request = GetCommunityRequest();

  request.keyword = _keyword;
  request.categoryId = _categoryId;
  request.filter = _filter.value;
  request.sortBy = _sortBy.apiKey;
  request.isDeleted = _isDeleted ?? true ? null : false;

  request.options = OptionsRequest();
  if (token != null) {
    request.options!.token = token;
  }
  if (limit != null) {
    request.options!.limit = limit;
  }

  if (_tags != null && _tags!.isNotEmpty) {
    request.tags = _tags;
  }

  final data = await useCase.get(request);

  return data;
}