unretweet method
Untweets a retweeted status. Returns the original Tweet with Retweet details embedded.
id
: The numerical ID of the desired status.
trimUser
: When true
, each tweet returned in a timeline will include a
user object including only the status authors numerical ID. Omit this
parameter to receive the complete user object.
tweetMode
: When set to extended
, uses the extended Tweets.
See https://developer.twitter.com/en/docs/tweets/data-dictionary/overview/intro-to-tweet-json#extendedtweet.
includeExtEditControl
: The includeExtEditControl
node will not be included when set to
false
. See https://developer.twitter.com/en/docs/twitter-api/v1/edit-tweets
transform
: Can be used to parse the request. By default, the response is
parsed in an isolate.
Implementation
Future<Tweet> unretweet({
required String id,
bool? trimUser,
bool? includeExtEditControl,
String tweetMode = 'extended',
TransformResponse<Tweet> transform = defaultTweetTransform,
}) {
final body = <String, String>{}
..addParameter('tweet_mode', tweetMode)
..addParameter('trim_user', trimUser)
..addParameter('include_ext_edit_control', includeExtEditControl);
return client
.post(
Uri.https('api.twitter.com', '1.1/statuses/unretweet/$id.json'),
body: body,
)
.then(transform);
}