unsubscribe method

Future<void> unsubscribe({
  1. List<SubredditRef>? otherSubreddits,
})

Unsubscribes from the subreddit.

When otherSubreddits is provided, the provided subreddits will also be unsubscribed from.

Implementation

Future<void> unsubscribe({List<SubredditRef>? otherSubreddits}) async {
  final data = {
    'action': 'unsub',
    'sr_name': _subredditList(this, otherSubreddits),
  };
  await _throwOnInvalidSubreddit(() async =>
      await reddit.post(apiPath['subscribe'], data, discardResponse: true));
}