toJson method

String toJson()

Converts this enum value to a string for API requests.

Implementation

String toJson() {
  switch (this) {
    case ModelSort.highestRated:
      return 'Highest Rated';
    case ModelSort.mostDownloaded:
      return 'Most Downloaded';
    case ModelSort.newest:
      return 'Newest';
    case ModelSort.oldest:
      return 'Oldest';
    case ModelSort.mostLiked:
      return 'Most Liked';
    case ModelSort.mostDiscussed:
      return 'Most Discussed';
    case ModelSort.mostCollected:
      return 'Most Collected';
    case ModelSort.imageCount:
      return 'Most Images';
  }
}