createStory method

Future<Response> createStory({
  1. required String? text,
  2. required String? attachedUrl,
  3. required int? user,
  4. required String? type,
})

Implementation

Future<http.Response> createStory({
  required String? text,
  required String? attachedUrl,
  required int? user,
  required String? type,
}) {
  var data = json.encode(
      {"text": text, "attachedUrl": attachedUrl, "user": user, "type": type});

  return post(Uri.parse('$apiURL/story/create'),
      headers: {
        "token":
            "cnejwi8c9wehnd8fchni2x239jxexnjx2n23i8xn3oifr0cwd32fjnrf453vreve",
        "content-type": 'application/json',
      },
      body: data);
}