groups.dart 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. import 'package:freezed_annotation/freezed_annotation.dart';
  2. import 'package:flutter/foundation.dart';
  3. part 'groups.freezed.dart';
  4. part 'groups.g.dart';
  5. @freezed
  6. class Groups with _$Groups {
  7. const factory Groups({Normal? normal, Normal? streaming}) = _Groups;
  8. factory Groups.fromJson(Map<String, Object?> json) => _$GroupsFromJson(json);
  9. }
  10. @freezed
  11. class Normal with _$Normal {
  12. const factory Normal({List<Tags>? tags, List<LocationList>? list}) = _Normal;
  13. factory Normal.fromJson(Map<String, Object?> json) => _$NormalFromJson(json);
  14. }
  15. @freezed
  16. class Tags with _$Tags {
  17. const factory Tags({int? id, String? name, String? icon, int? sort}) = _Tags;
  18. factory Tags.fromJson(Map<String, Object?> json) => _$TagsFromJson(json);
  19. }
  20. @freezed
  21. class LocationList with _$LocationList {
  22. const factory LocationList({
  23. int? id,
  24. String? name,
  25. String? icon,
  26. int? tag,
  27. List<Locations>? locations,
  28. }) = _LocationList;
  29. factory LocationList.fromJson(Map<String, Object?> json) =>
  30. _$LocationListFromJson(json);
  31. }
  32. @freezed
  33. class Locations with _$Locations {
  34. const factory Locations({
  35. int? id,
  36. String? name,
  37. String? code,
  38. String? icon,
  39. String? country,
  40. int? sort,
  41. }) = _Locations;
  42. factory Locations.fromJson(Map<String, Object?> json) =>
  43. _$LocationsFromJson(json);
  44. }