ListsService class

A list is a curated group of Twitter accounts. You can create your own lists or subscribe to lists created by others for the authenticated user.

Viewing a list timeline will show you a stream of Tweets from only the accounts on that list.

Endpoints: GET lists/members GET lists/members/show GET lists/memberships GET lists/ownerships GET lists/show GET lists/statuses GET lists/subscribers GET lists/subscribers/show GET lists/subscriptions

POST lists/create POST lists/destroy POST lists/members/create POST lists/members/create_all POST lists/members/destroy POST lists/members/destroy_all POST lists/subscribers/create POST lists/subscribers/destroy POST lists/update

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

Constructors

ListsService({required AbstractTwitterClient client})
const

Properties

client AbstractTwitterClient
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

create({String? name, String? mode, String? description, TransformResponse<TwitterList> transform = defaultTwitterListTransform}) Future<TwitterList>
Creates a new list for the authenticated user. Note that you can create up to 1000 lists per account.
destroy({String? ownerScreenName, String? ownerId, String? listId, String? slug, TransformResponse<TwitterList> transform = defaultTwitterListTransform}) Future<TwitterList>
Deletes the specified list. The authenticated user must own the list to be able to destroy it.
list({String? userId, String? screenName, bool? reverse, TransformResponse<List<TwitterList>> transform = defaultTwitterListsTransform}) Future<List<TwitterList>>
Returns all lists the authenticating or specified user subscribes to, including their own.
members({String? listId, String? slug, String? ownerScreenName, String? ownerId, int? count, String? cursor, bool? includeEntities, bool? skipStatus, String tweetMode = 'extended', TransformResponse<PaginatedUsers> transform = defaultPaginatedUsersTransform}) Future<PaginatedUsers>
Returns the members of the specified list. Private list members will only be shown if the authenticated user owns the specified list.
membersCreate({String? ownerScreenName, String? ownerId, String? listId, String? slug, String? userId, String? screenName}) Future<void>
Add a member to a list. The authenticated user must own the list to be able to add members to it. Note that lists cannot have more than 5,000 members.
membersCreateAll({String? ownerScreenName, String? ownerId, String? listId, String? slug, List<String>? userId, List<String>? screenName}) Future<void>
Adds multiple members to a list, by specifying a comma-separated list of member ids or screen names. The authenticated user must own the list to be able to add members to it. Note that lists can't have more than 5,000 members, and you are limited to adding up to 100 members to a list at a time with this method.
membersDestroy({String? ownerScreenName, String? ownerId, String? listId, String? slug, String? userId, String? screenName}) Future<void>
Removes the specified member from the list. The authenticated user must be the list's owner to remove members from the list.
membersDestroyAll({String? ownerScreenName, String? ownerId, String? listId, String? slug, List<String>? userId, List<String>? screenName}) Future<void>
Removes multiple members from a list, by specifying a comma-separated list of member ids or screen names. The authenticated user must own the list to be able to remove members from it. Note that lists can't have more than 500 members, and you are limited to removing up to 100 members to a list at a time with this method.
memberships({String? userId, String? screenName, int? count, String? cursor, bool? filterToOwnedLists, TransformResponse<PaginatedTwitterLists> transform = defaultPaginatedTwitterListsTransform}) Future<PaginatedTwitterLists>
Returns the lists the specified user has been added to. If userId or screenName are not provided, the memberships for the authenticating user are returned.
membersShow({String? listId, String? slug, String? userId, String? screenName, String? ownerScreenName, String? ownerId, bool? includeEntities, bool? skipStatus, String tweetMode = 'extended', TransformResponse<User> transform = defaultUserTransform}) Future<User>
Check if the specified user is a member of the specified list.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
ownerships({String? userId, String? screenName, int? count, String? cursor, TransformResponse<PaginatedTwitterLists> transform = defaultPaginatedTwitterListsTransform}) Future<PaginatedTwitterLists>
Returns the lists owned by the specified Twitter user. Private lists will only be shown if the authenticated user is also the owner of the lists.
show({String? listId, String? slug, String? ownerScreenName, String? ownerId, TransformResponse<TwitterList> transform = defaultTwitterListTransform}) Future<TwitterList>
Returns the specified list. Private lists will only be shown if the authenticated user owns the specified list.
statuses({String? listId, String? slug, String? ownerScreenName, String? ownerId, String? sinceId, String? maxId, int? count, bool? includeEntities, bool? includeRts, bool? includeExtEditControl, String tweetMode = 'extended', TransformResponse<List<Tweet>> transform = defaultTweetListTransform}) Future<List<Tweet>>
Returns a timeline of tweets authored by members of the specified list. Retweets are included by default. Use the includeRts=false parameter to omit retweets.
subscribers({String? listId, String? slug, String? ownerScreenName, String? ownerId, int? count, String? cursor, bool? includeEntities, bool? skipStatus, String tweetMode = 'extended', TransformResponse<PaginatedUsers> transform = defaultPaginatedUsersTransform}) Future<PaginatedUsers>
Returns the subscribers of the specified list. Private list subscribers will only be shown if the authenticated user owns the specified list.
subscribersCreate({String? ownerScreenName, String? ownerId, String? listId, String? slug, TransformResponse<TwitterList> transform = defaultTwitterListTransform}) Future<TwitterList>
Subscribes the authenticated user to the specified list.
subscribersDestroy({String? ownerScreenName, String? ownerId, String? listId, String? slug}) Future<void>
Unsubscribes the authenticated user from the specified list.
subscribersShow({String? listId, String? slug, String? ownerScreenName, String? ownerId, String? userId, String? screenName, bool? includeEntities, bool? skipStatus, String tweetMode = 'extended', TransformResponse<User> transform = defaultUserTransform}) Future<User>
Check if the specified user is a subscriber of the specified list. Returns the user if they are a subscriber.
subscriptions({String? userId, String? screenName, String? count, String? cursor, TransformResponse<PaginatedTwitterLists> transform = defaultPaginatedTwitterListsTransform}) Future<PaginatedTwitterLists>
Obtain a collection of the lists the specified user is subscribed to, 20 lists per page by default. Does not include the user's own lists.
toString() String
A string representation of this object.
inherited
update({String? ownerScreenName, String? ownerId, String? listId, String? slug, String? name, String? mode, String? description}) Future<void>
Updates the specified list. The authenticated user must own the list to be able to update it.

Operators

operator ==(Object other) bool
The equality operator.
inherited