LoginMode.dart 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. import 'UserMode.dart';
  2. class LoginMode {
  3. String? accessToken;
  4. User? user;
  5. String? tutorial;
  6. String? swoftdownload;
  7. String? affurl;
  8. String? userLoginUrl;
  9. String? userBuy;
  10. String? userTicket;
  11. String? clashConfig;
  12. LoginMode(
  13. {this.accessToken,
  14. this.user,
  15. this.tutorial,
  16. this.swoftdownload,
  17. this.affurl,
  18. this.userLoginUrl,
  19. this.userBuy,
  20. this.userTicket,
  21. this.clashConfig});
  22. LoginMode.fromJson(Map<String, dynamic> json) {
  23. accessToken = json['access_token'];
  24. user = json['user'] != null ? User.fromJson(json['user']) : null;
  25. tutorial = json['tutorial'];
  26. swoftdownload = json['swoftdownload'];
  27. affurl = json['affurl'];
  28. userLoginUrl = json['user_login_url'];
  29. userBuy = json['user_buy'];
  30. userTicket = json['user_ticket'];
  31. clashConfig = json['clash_config'];
  32. }
  33. Map<String, dynamic> toJson() {
  34. final Map<String, dynamic> data = new Map<String, dynamic>();
  35. data['access_token'] = this.accessToken;
  36. if (this.user != null) {
  37. data['user'] = this.user!.toJson();
  38. }
  39. data['tutorial'] = this.tutorial;
  40. data['swoftdownload'] = this.swoftdownload;
  41. data['affurl'] = this.affurl;
  42. data['user_login_url'] = this.userLoginUrl;
  43. data['user_buy'] = this.userBuy;
  44. data['user_ticket'] = this.userTicket;
  45. data['clash_config'] = this.clashConfig;
  46. return data;
  47. }
  48. }