user_score_model.dart 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. class UserScoreModelRows {
  2. String? opType;
  3. int? changeExp;
  4. String? logTime;
  5. UserScoreModelRows({
  6. this.opType,
  7. this.changeExp,
  8. this.logTime,
  9. });
  10. UserScoreModelRows.fromJson(Map<String, dynamic> json) {
  11. opType = json['opType']?.toString();
  12. changeExp = json['changeExp']?.toInt();
  13. logTime = json['logTime']?.toString();
  14. }
  15. Map<String, dynamic> toJson() {
  16. final data = <String, dynamic>{};
  17. data['opType'] = opType;
  18. data['changeExp'] = changeExp;
  19. data['logTime'] = logTime;
  20. return data;
  21. }
  22. }
  23. class UserScoreModel {
  24. List<UserScoreModelRows?>? rows;
  25. String? total;
  26. UserScoreModel({
  27. this.rows,
  28. this.total,
  29. });
  30. UserScoreModel.fromJson(Map<String, dynamic> json) {
  31. if (json['rows'] != null) {
  32. final v = json['rows'];
  33. final arr0 = <UserScoreModelRows>[];
  34. v.forEach((v) {
  35. arr0.add(UserScoreModelRows.fromJson(v));
  36. });
  37. rows = arr0;
  38. }
  39. total = json['total']?.toString();
  40. }
  41. Map<String, dynamic> toJson() {
  42. final data = <String, dynamic>{};
  43. if (rows != null) {
  44. final v = rows;
  45. final arr0 = [];
  46. for (var v in v!) {
  47. arr0.add(v!.toJson());
  48. }
  49. data['rows'] = arr0;
  50. }
  51. data['total'] = total;
  52. return data;
  53. }
  54. }