creator.dart 707 B

12345678910111213141516171819202122232425262728293031
  1. class Creator {
  2. final int favorited;
  3. final String id;
  4. final int indexed;
  5. final String name;
  6. final String service;
  7. final int updated;
  8. final String baseUrl;
  9. Creator({
  10. required this.favorited,
  11. required this.id,
  12. required this.indexed,
  13. required this.name,
  14. required this.service,
  15. required this.updated,
  16. required this.baseUrl,
  17. });
  18. String get iconUrl => '$baseUrl/icons/$service/$id';
  19. factory Creator.fromJson(Map<String, dynamic> json, String baseUrl) => Creator(
  20. favorited: json['favorited'],
  21. id: json['id'],
  22. indexed: json['indexed'],
  23. name: json['name'],
  24. service: json['service'],
  25. updated: json['updated'],
  26. baseUrl: baseUrl,
  27. );
  28. }