friendshipsLookup method

Future<List<Friendship>> friendshipsLookup({
  1. List<String>? screenNames,
  2. List<String>? userIds,
  3. TransformResponse<List<Friendship>> transform = defaultFriendshipsTransform,
})

Returns the relationships of the authenticating user to the list of up to 100 screenNames or userIds provided.

Values for Friendship.connections can be: following, following_requested, followed_by, none, blocking, muting.

screenNames: A list of screen names, up to 100 are allowed in a single request.

userIds: A list of user IDs, up to 100 are allowed in a single request.

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-lookup.

Implementation

Future<List<Friendship>> friendshipsLookup({
  List<String>? screenNames,
  List<String>? userIds,
  TransformResponse<List<Friendship>> transform = defaultFriendshipsTransform,
}) async {
  final params = <String, String>{}
    ..addParameter('user_id', userIds)
    ..addParameter('screen_name', screenNames);

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