sessions.dart 762 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. // @dart=2.9
  2. class Sessions {
  3. final List<Session> sessions;
  4. Sessions(
  5. this.sessions,
  6. );
  7. factory Sessions.fromMap(Map<String, dynamic> map) {
  8. return Sessions(
  9. List<Session>.from(map['sessions']?.map((x) => Session.fromMap(x))),
  10. );
  11. }
  12. }
  13. class Session {
  14. final String token;
  15. final int creationTime;
  16. final String ip;
  17. final String ua;
  18. final String prettyUA;
  19. final int lastUsedTime;
  20. Session(
  21. this.token,
  22. this.creationTime,
  23. this.ip,
  24. this.ua,
  25. this.prettyUA,
  26. this.lastUsedTime,
  27. );
  28. factory Session.fromMap(Map<String, dynamic> map) {
  29. return Session(
  30. map['token'],
  31. map['creationTime'],
  32. map['ip'],
  33. map['ua'],
  34. map['prettyUA'],
  35. map['lastUsedTime'],
  36. );
  37. }
  38. }