friendshipsDestroy method
Future<User>
friendshipsDestroy({
- String? userId,
- String? screenName,
- String tweetMode = 'extended',
- TransformResponse<
User> transform = defaultUserTransform,
Allows the authenticating user to unfollow the user specified in the ID parameter.
Returns the unfollowed user when successful. Returns a string describing the failure condition when unsuccessful.
Actions taken in this method are asynchronous. Changes will be eventually consistent.
userId
: The ID of the user to unfollow.
screenName
: The screen name of the user to unfollow.
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.
transform
: Can be used to parse the request. By default, the response is
parsed in an isolate.
Implementation
Future<User> friendshipsDestroy({
String? userId,
String? screenName,
String tweetMode = 'extended',
TransformResponse<User> transform = defaultUserTransform,
}) async {
final body = <String, String>{}
..addParameter('user_id', userId)
..addParameter('screen_name', screenName)
..addParameter('tweet_mode', tweetMode);
return client
.post(
Uri.https('api.twitter.com', '1.1/friendships/destroy.json'),
body: body,
)
.then(transform);
}