list method

Future<List<TwitterList>> list({
  1. String? userId,
  2. String? screenName,
  3. bool? reverse,
  4. TransformResponse<List<TwitterList>> transform = defaultTwitterListsTransform,
})

Returns all lists the authenticating or specified user subscribes to, including their own.

The user is specified using the userId or screenName parameters. If no user is given, the authenticating user is used.

A maximum of 100 results will be returned by this call. Subscribed lists are returned first, followed by owned lists.This means that if a user subscribes to 90 lists and owns 20 lists, this method returns 90 subscriptions and 10 owned lists. The reverse method returns owned lists first, so with reverse=true, 20 owned lists and 80 subscriptions would be returned. If your goal is to obtain every list a user owns or subscribes to, use ownerships and/or subscriptions instead.

userId The ID of the user for whom to return results.

screenName The screen name of the user for whom to return results.

reverse Set this to true if you would like owned lists to be returned first.

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

See https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/get-lists-list.

Implementation

Future<List<TwitterList>> list({
  String? userId,
  String? screenName,
  bool? reverse,
  TransformResponse<List<TwitterList>> transform =
      defaultTwitterListsTransform,
}) async {
  final params = <String, String>{}
    ..addParameter('user_id', userId)
    ..addParameter('screen_name', screenName)
    ..addParameter('reverse', reverse);

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