followPlaylist method

Future<void> followPlaylist(
  1. String playlistId, {
  2. bool? isPublic,
})

Follows a playlist identified by playlistId. Optional isPublic sets whether the follow is public.

Implementation

Future<void> followPlaylist(String playlistId, {bool? isPublic}) async {
  final uri = Uri.https(
    _baseApiHost,
    '/v1/playlists/$playlistId/followers',
  );

  final body = isPublic != null ? {'public': isPublic} : null;
  await _putJson(uri, body);
}