remove method

Future<void> remove(
  1. dynamic redditor, {
  2. Map<String, String>? params,
})

Remove a Redditor from this relationship.

redditor can be either an instance of Redditor or the name of a Redditor.

Implementation

Future<void> remove(/* String, Redditor */ redditor,
    {Map<String, String>? params}) async {
  final data = {
    'name': _redditorNameHelper(redditor),
    'type': relationship,
  };
  if (params != null) {
    data.addAll(params);
  }
  await _subreddit.reddit.post(
      apiPath['unfriend']
          .replaceAll(SubredditRef._subredditRegExp, _subreddit.displayName),
      data,
      discardResponse: true);
}