You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

53 lines
1.1 KiB

2 years ago
  1. class UserData {
  2. final String uid;
  3. final String name;
  4. final String username;
  5. final int timestamp;
  6. UserData({
  7. required this.uid,
  8. required this.name,
  9. required this.username,
  10. required this.timestamp,
  11. });
  12. UserData.fromJson(Map<String, dynamic> json)
  13. : uid = json['uid'],
  14. name = json['name'],
  15. username = json['username'],
  16. timestamp = json['timestamp'];
  17. Map<String, dynamic> toJson() => {
  18. 'uid': uid,
  19. 'name': name,
  20. 'username': username,
  21. 'timestamp': timestamp,
  22. };
  23. }
  24. class EUserData {
  25. final String uid;
  26. final String username;
  27. final String email;
  28. final int timestamp;
  29. EUserData({
  30. required this.uid,
  31. required this.username,
  32. required this.email,
  33. required this.timestamp,
  34. });
  35. EUserData.fromJson(Map<String, dynamic> json)
  36. : uid = json['uid'],
  37. username = json['username'],
  38. email = json['email'],
  39. timestamp = json['timestamp'];
  40. Map<String, dynamic> toJson() => {
  41. 'uid': uid,
  42. 'username': username,
  43. 'email': email,
  44. 'timestamp': timestamp,
  45. };
  46. }