groups.dart 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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({
  8. Normal? normal,
  9. }) = _Groups;
  10. factory Groups.fromJson(Map<String, Object?> json) => _$GroupsFromJson(json);
  11. }
  12. @freezed
  13. class Normal with _$Normal {
  14. const factory Normal({
  15. List<Tags>? tags,
  16. List<LocationList>? list,
  17. }) = _Normal;
  18. factory Normal.fromJson(Map<String, Object?> json) => _$NormalFromJson(json);
  19. }
  20. @freezed
  21. class Tags with _$Tags {
  22. const factory Tags({
  23. int? id,
  24. String? name,
  25. String? icon,
  26. int? sort,
  27. }) = _Tags;
  28. factory Tags.fromJson(Map<String, Object?> json) => _$TagsFromJson(json);
  29. }
  30. @freezed
  31. class LocationList with _$LocationList {
  32. const factory LocationList({
  33. int? id,
  34. String? name,
  35. String? icon,
  36. int? tag,
  37. List<Locations>? locations,
  38. }) = _LocationList;
  39. factory LocationList.fromJson(Map<String, Object?> json) =>
  40. _$LocationListFromJson(json);
  41. }
  42. @freezed
  43. class Locations with _$Locations {
  44. const factory Locations({
  45. int? id,
  46. String? name,
  47. String? code,
  48. Param? param,
  49. dynamic paramV2,
  50. String? icon,
  51. String? country,
  52. int? sort,
  53. int? latency,
  54. }) = _Locations;
  55. factory Locations.fromJson(Map<String, Object?> json) =>
  56. _$LocationsFromJson(json);
  57. }
  58. @freezed
  59. class Param with _$Param {
  60. const factory Param({
  61. String? g,
  62. }) = _Param;
  63. factory Param.fromJson(Map<String, Object?> json) => _$ParamFromJson(json);
  64. }