addPost method
Implementation
Future<http.Response> addPost({
required UserModel user,
required String? title,
required String? description,
required String? type,
String? attachedUrl,
int? pollQuestionId,
}) {
var data = json.encode({
"user": user.id,
"description": description,
"type": type,
"attachedUrl": attachedUrl,
"title": title,
"pollQuestion": pollQuestionId
});
log(data);
return post(Uri.parse('$apiURL/posts/create'),
headers: {
"token":
"cnejwi8c9wehnd8fchni2x239jxexnjx2n23i8xn3oifr0cwd32fjnrf453vreve",
"content-type": 'application/json',
},
body: data);
}