getFeeds function

Future<List<FeedResponse>?> getFeeds({
  1. required String address,
  2. int page = Pagination.INITIAL_PAGE,
  3. int limit = Pagination.LIMIT,
  4. bool spam = false,
  5. bool raw = false,
})

Implementation

Future<List<FeedResponse>?> getFeeds({
  required String address,
  int page = Pagination.INITIAL_PAGE,
  int limit = Pagination.LIMIT,
  bool spam = false,
  bool raw = false,
}) async {
  final userDID = await getCAIPAddress(address: address);

  final queryObj = {
    'page': page,
    'limit': limit,
    'spam': spam,
  };
  final path = '/v1/users/$userDID/feeds?${getQueryParams(queryObj)}';

  final result = await http.get(path: path);
  if (result == null) {
    return null;
  }

  return parseApiResponse(result["feeds"]);
}