retweets method

Future<List<Tweet>> retweets({
  1. required String id,
  2. int? count,
  3. bool? trimUser,
  4. String tweetMode = 'extended',
  5. bool? includeExtEditControl,
  6. TransformResponse<List<Tweet>> transform = defaultTweetListTransform,
})

Returns a collection of the 100 most recent retweets of the Tweet specified by the id parameter.

id: The numerical ID of the desired status.

count: Specifies the number of records to retrieve. Must be less than or equal to 100.

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.

includeExtEditControl: The includeExtEditControl node will not be included when set to false. See https://developer.twitter.com/en/docs/twitter-api/v1/edit-tweets

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.

See https://developer.twitter.com/en/docs/tweets/post-and-engage/api-reference/get-statuses-retweets-id.

Implementation

Future<List<Tweet>> retweets({
  required String id,
  int? count,
  bool? trimUser,
  String tweetMode = 'extended',
  bool? includeExtEditControl,
  TransformResponse<List<Tweet>> transform = defaultTweetListTransform,
}) {
  final params = <String, String>{}
    ..addParameter('trim_user', trimUser)
    ..addParameter('count', count)
    ..addParameter('tweet_mode', tweetMode)
    ..addParameter('include_ext_edit_control', includeExtEditControl);

  return client
      .get(
        Uri.https(
          'api.twitter.com',
          '1.1/statuses/retweets/$id.json',
          params,
        ),
      )
      .then(transform);
}