user_friend.dart 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. import 'package:azlistview/azlistview.dart';
  2. import 'package:sport/bean/user_info.dart';
  3. import 'package:sport/services/Converter.dart';
  4. class UserFriend extends ISuspensionBean{
  5. int uid;
  6. String isFriends;
  7. int isIgnore;
  8. String groups;
  9. String createdAt;
  10. String updatedAt;
  11. UserInfo socialInfo;
  12. String makeFrom;
  13. String name;
  14. String avatar;
  15. UserFriend(
  16. {this.uid,
  17. this.isFriends,
  18. this.groups,
  19. this.createdAt,
  20. this.updatedAt,
  21. this.socialInfo,
  22. this.makeFrom,
  23. this.name,
  24. this.avatar,
  25. });
  26. UserFriend.fromJson(Map<String, dynamic> json) {
  27. uid = Converter.toInt(json['uid']);
  28. isFriends = json['is_friends'];
  29. isIgnore = Converter.toInt(json['is_ignore']);
  30. groups = json['groups'];
  31. createdAt = json['created_at'];
  32. updatedAt = json['updated_at'];
  33. socialInfo = json['socialInfo'] != null
  34. ? new UserInfo.fromJson(json['socialInfo'])
  35. : null;
  36. makeFrom = json['make_from'];
  37. name = json['name'];
  38. avatar = json['avatar'];
  39. }
  40. Map<String, dynamic> toJson() {
  41. final Map<String, dynamic> data = new Map<String, dynamic>();
  42. data['uid'] = this.uid;
  43. data['is_friends'] = this.isFriends;
  44. data['groups'] = this.groups;
  45. data['created_at'] = this.createdAt;
  46. data['updated_at'] = this.updatedAt;
  47. if (this.socialInfo != null) {
  48. data['socialInfo'] = this.socialInfo.toJson();
  49. }
  50. data['make_from'] = this.makeFrom;
  51. data['name'] = this.name;
  52. data['avatar'] = this.avatar;
  53. return data;
  54. }
  55. @override
  56. String getSuspensionTag() => '$uid';
  57. }
  58. class NewFriend {
  59. int id;
  60. String name;
  61. String level;
  62. String score;
  63. String isBan;
  64. String provinceId;
  65. String cityId;
  66. String districtId;
  67. String gender;
  68. String age;
  69. String avatar;
  70. String city;
  71. NewFriend(
  72. this.id,
  73. this.name,
  74. this.level,
  75. this.score,
  76. this.isBan,
  77. this.provinceId,
  78. this.cityId,
  79. this.districtId,
  80. this.gender,
  81. this.age,
  82. this.avatar,
  83. this.city);
  84. NewFriend.fromJson(Map<String, dynamic> json) {
  85. id = Converter.toInt(json['id']);
  86. name = json['name'];
  87. level = json['level'];
  88. score = json['score'];
  89. isBan = json['is_ban'];
  90. provinceId = json['province_id'];
  91. cityId = json['city_id'];
  92. districtId = json['district_id'];
  93. gender = json['gender'];
  94. age = json['age'];
  95. avatar = json['avatar'];
  96. city = json['city'];
  97. }
  98. Map<String, dynamic> toJson() {
  99. final Map<String, dynamic> data = new Map<String, dynamic>();
  100. data['id'] = this.id;
  101. data['name'] = this.name;
  102. data['level'] = this.level;
  103. data['isBan'] = this.isBan;
  104. data['provinceId'] = this.provinceId;
  105. data['cityId'] = this.cityId;
  106. data['districtId'] = this.districtId;
  107. data['gender'] = this.gender;
  108. data['age'] = this.age;
  109. data['avatar'] = this.avatar;
  110. data['city'] = this.city;
  111. return data;
  112. }
  113. }