update method

Future<void> update(
  1. String templateId,
  2. String text, {
  3. String cssClass = '',
  4. bool textEditable = false,
})

Implementation

Future<void> update(String templateId, String text,
    {String cssClass = '', bool textEditable = false}) async {
  final url = apiPath['flairtemplate']
      .replaceAll(_kSubredditRegExp, _subreddit.displayName);
  final data = <String, String>{
    'api_type': 'json',
    'css_class': cssClass,
    'flair_template_id': templateId,
    'text': text,
    'text_editable': textEditable.toString(),
  };
  await _subreddit.reddit.post(url, data);
}