toJson method

String toJson()

Converts this enum value to a string for API requests.

Implementation

String toJson() {
  switch (this) {
    case ImageSort.mostReactions:
      return 'Most Reactions';
    case ImageSort.mostComments:
      return 'Most Comments';
    case ImageSort.mostCollected:
      return 'Most Collected';
    case ImageSort.newest:
      return 'Newest';
    case ImageSort.oldest:
      return 'Oldest';
    case ImageSort.random:
      return 'Random';
  }
}