getShares method

Future<OrderedPagedCollection> getShares(
  1. String postId
)

Implementation

Future<OrderedPagedCollection> getShares(String postId) async {
  String formattedUrl =
      "https://${Config.domainName}/shares/${Uri.encodeQueryComponent(postId)}";

  http.Response response =
      await http.get(Uri.parse(formattedUrl), headers: <String, String>{});

  OrderedPagedCollection collection = OrderedPagedCollection.fromJson(
      jsonDecode(utf8.decode(response.bodyBytes)));
  return collection;
}