destroy method
Future<TwitterList>
destroy({
- String? ownerScreenName,
- String? ownerId,
- String? listId,
- String? slug,
- TransformResponse<
TwitterList> transform = defaultTwitterListTransform,
Deletes the specified list. The authenticated user must own the list to be able to destroy it.
ownerScreenName
The screen name of the user who owns the list being
requested by a slug
.
ownerId
The user ID of the user who owns the list being requested by
a slug
.
listId
The numerical id of the list.
slug
You can identify a list by its slug instead of its numerical id.
If you decide to do so, note that you'll also have to specify the list
owner using the ownerId
or ownerScreenName
parameters.
transform
Can be used to parse the request. By default, the response is
parsed in an isolate.
Implementation
Future<TwitterList> destroy({
String? ownerScreenName,
String? ownerId,
String? listId,
String? slug,
TransformResponse<TwitterList> transform = defaultTwitterListTransform,
}) async {
final body = <String, String>{}
..addParameter('owner_screen_name', ownerScreenName)
..addParameter('owner_id', ownerId)
..addParameter('list_id', listId)
..addParameter('slug', slug);
return client
.post(
Uri.https('api.twitter.com', '1.1/lists/destroy.json'),
body: body,
)
.then(transform);
}