getPosts<T> method

Future<OrderedCollectionPage<T>> getPosts<T>(
  1. String nextUrl
)

Implementation

Future<OrderedCollectionPage<T>> getPosts<T>(String nextUrl) async {
  Uri nextUri = Uri.parse(nextUrl);

  if (nextUri.authority != Config.domainName) {
    nextUri = nextUri.asProxyUri();
  }

  http.Response pageResponse = await http.get(nextUri);

  OrderedCollectionPage<T> collection = OrderedCollectionPage<T>.fromJson(
      jsonDecode(utf8.decode(pageResponse.bodyBytes)));

  return collection;
}