chat_room_backgrounds_model.dart 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. /// code : "OK"
  2. /// data : {"list":[{"backgroundId":29,"backgroundName":"拍卖","backgroundIsDynamic":0,"backgroundUrl":"http://media.qn.timichat.net/rtc/background/1627720828463.png","dynamicFile":null},{"backgroundId":24,"backgroundName":"2111","backgroundIsDynamic":1,"backgroundUrl":"http://media.qn.timichat.net/rtc/background/1616038846512.png","dynamicFile":"http://media.qn.timichat.net/rtc/background/1616038846512.png"},{"backgroundId":28,"backgroundName":"2","backgroundIsDynamic":0,"backgroundUrl":"http://media.qn.timichat.net/rtc/background/1619090342605.png","dynamicFile":null},{"backgroundId":27,"backgroundName":"1","backgroundIsDynamic":0,"backgroundUrl":"http://media.qn.timichat.net/rtc/background/1619090327535.png","dynamicFile":null}]}
  3. /// msg : ""
  4. /// success : true
  5. class ChatRoomBackgroundsModel {
  6. String? _code;
  7. Data? _data;
  8. String? _msg;
  9. bool? _success;
  10. String? get code => _code;
  11. Data? get data => _data;
  12. String? get msg => _msg;
  13. bool? get success => _success;
  14. ChatRoomBackgroundsModel({
  15. String? code,
  16. Data? data,
  17. String? msg,
  18. bool? success}){
  19. _code = code;
  20. _data = data;
  21. _msg = msg;
  22. _success = success;
  23. }
  24. ChatRoomBackgroundsModel.fromJson(dynamic json) {
  25. _code = json['code'];
  26. _data = json['data'] != null ? Data.fromJson(json['data']) : null;
  27. _msg = json['msg'];
  28. _success = json['success'];
  29. }
  30. Map<String, dynamic> toJson() {
  31. var map = <String, dynamic>{};
  32. map['code'] = _code;
  33. if (_data != null) {
  34. map['data'] = _data?.toJson();
  35. }
  36. map['msg'] = _msg;
  37. map['success'] = _success;
  38. return map;
  39. }
  40. }
  41. /// list : [{"backgroundId":29,"backgroundName":"拍卖","backgroundIsDynamic":0,"backgroundUrl":"http://media.qn.timichat.net/rtc/background/1627720828463.png","dynamicFile":null},{"backgroundId":24,"backgroundName":"2111","backgroundIsDynamic":1,"backgroundUrl":"http://media.qn.timichat.net/rtc/background/1616038846512.png","dynamicFile":"http://media.qn.timichat.net/rtc/background/1616038846512.png"},{"backgroundId":28,"backgroundName":"2","backgroundIsDynamic":0,"backgroundUrl":"http://media.qn.timichat.net/rtc/background/1619090342605.png","dynamicFile":null},{"backgroundId":27,"backgroundName":"1","backgroundIsDynamic":0,"backgroundUrl":"http://media.qn.timichat.net/rtc/background/1619090327535.png","dynamicFile":null}]
  42. class Data {
  43. List<BackGroundInfo>? _list;
  44. List<BackGroundInfo>? get list => _list;
  45. Data({
  46. List<BackGroundInfo>? list}){
  47. _list = list;
  48. }
  49. Data.fromJson(dynamic json) {
  50. if (json['list'] != null) {
  51. _list = [];
  52. json['list'].forEach((v) {
  53. _list?.add(BackGroundInfo.fromJson(v));
  54. });
  55. }
  56. }
  57. Map<String, dynamic> toJson() {
  58. var map = <String, dynamic>{};
  59. if (_list != null) {
  60. map['list'] = _list?.map((v) => v.toJson()).toList();
  61. }
  62. return map;
  63. }
  64. }
  65. /// backgroundId : 29
  66. /// backgroundName : "拍卖"
  67. /// backgroundIsDynamic : 0
  68. /// backgroundUrl : "http://media.qn.timichat.net/rtc/background/1627720828463.png"
  69. /// dynamicFile : null
  70. class BackGroundInfo {
  71. int? _backgroundId;
  72. String? _backgroundName;
  73. int? _backgroundIsDynamic;
  74. String? _backgroundUrl;
  75. dynamic? _dynamicFile;
  76. int? get backgroundId => _backgroundId;
  77. String? get backgroundName => _backgroundName;
  78. int? get backgroundIsDynamic => _backgroundIsDynamic;
  79. String? get backgroundUrl => _backgroundUrl;
  80. dynamic? get dynamicFile => _dynamicFile;
  81. BackGroundInfo({
  82. int? backgroundId,
  83. String? backgroundName,
  84. int? backgroundIsDynamic,
  85. String? backgroundUrl,
  86. dynamic? dynamicFile}){
  87. _backgroundId = backgroundId;
  88. _backgroundName = backgroundName;
  89. _backgroundIsDynamic = backgroundIsDynamic;
  90. _backgroundUrl = backgroundUrl;
  91. _dynamicFile = dynamicFile;
  92. }
  93. BackGroundInfo.fromJson(dynamic json) {
  94. _backgroundId = json['backgroundId'];
  95. _backgroundName = json['backgroundName'];
  96. _backgroundIsDynamic = json['backgroundIsDynamic'];
  97. _backgroundUrl = json['backgroundUrl'];
  98. _dynamicFile = json['dynamicFile'];
  99. }
  100. Map<String, dynamic> toJson() {
  101. var map = <String, dynamic>{};
  102. map['backgroundId'] = _backgroundId;
  103. map['backgroundName'] = _backgroundName;
  104. map['backgroundIsDynamic'] = _backgroundIsDynamic;
  105. map['backgroundUrl'] = _backgroundUrl;
  106. map['dynamicFile'] = _dynamicFile;
  107. return map;
  108. }
  109. }