update method

Future<void> update({
  1. String? ownerScreenName,
  2. String? ownerId,
  3. String? listId,
  4. String? slug,
  5. String? name,
  6. String? mode,
  7. String? description,
})

Updates the specified list. The authenticated user must own the list to be able to update 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.

name The name for the list.

mode Whether your list is public or private. Values can be public or private. If no mode is specified the list will be public.

description The description to give the list.

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

Implementation

Future<void> update({
  String? ownerScreenName,
  String? ownerId,
  String? listId,
  String? slug,
  String? name,
  String? mode,
  String? description,
}) async {
  final body = <String, String>{}
    ..addParameter('owner_screen_name', ownerScreenName)
    ..addParameter('owner_id', ownerId)
    ..addParameter('list_id', listId)
    ..addParameter('slug', slug)
    ..addParameter('name', name)
    ..addParameter('mode', mode)
    ..addParameter('description', description);

  await client.post(
    Uri.https('api.twitter.com', '1.1/lists/update.json'),
    body: body,
  );
}