share method

void share(
  1. String postId
)

Implementation

void share(String postId) async {
  Map<String, dynamic> body = {
    "to": ["as:Public"],
    "type": "Announce",
    "object": postId
  };

  String json = jsonEncode(body);

  await AuthBaseApi.post(
    url:
        Uri.parse("https://${Config.domainName}/outbox/${Config.ownActorId}"),
    headers: <String, String>{
      "content-type": "application/json",
    },
    body: json,
  );
}