sticky method

Future<void> sticky({
  1. bool state = true,
  2. bool bottom = true,
})

Set the Submission's sticky state in its Subreddit.

If state is true, the Submission is stickied. If false, it is unstickied.

If bottom is true, the Submission is set as the bottom sticky. If no top sticky exists, this Submission will become the top sticky.

Implementation

Future<void> sticky({bool state = true, bool bottom = true}) async {
  final data = <String, String>{
    'id': _content.fullname!,
    'state': state.toString(),
    'api_type': 'json',
  };
  if (!bottom) {
    data['num'] = '1';
  }
  return _content.reddit.post(apiPath['sticky_submission'], data);
}