friendshipsShow method

Future<Relationship> friendshipsShow({
  1. String? sourceId,
  2. String? sourceScreenName,
  3. String? targetId,
  4. String? targetScreenName,
  5. TransformResponse<Relationship> transform = defaultRelationshipTransform,
})

Returns detailed information about the relationship between two arbitrary users.

sourceId: The user ID of the subject user.

sourceScreenName: The screen name of the subject user.

targetId: The user ID of the target user.

targetScreenName: The screen name of the target user.

transform: Can be used to parse the request. By default, the response is parsed in an isolate.

See https://developer.twitter.com/en/docs/accounts-and-users/follow-search-get-users/api-reference/get-friendships-show.

Implementation

Future<Relationship> friendshipsShow({
  String? sourceId,
  String? sourceScreenName,
  String? targetId,
  String? targetScreenName,
  TransformResponse<Relationship> transform = defaultRelationshipTransform,
}) async {
  final params = <String, String>{}
    ..addParameter('source_id', sourceId)
    ..addParameter('source_screen_name', sourceScreenName)
    ..addParameter('target_id', targetId)
    ..addParameter('target_screen_name', targetScreenName);

  return client
      .get(Uri.https('api.twitter.com', '1.1/friendships/show.json', params))
      .then(transform);
}