logged_in_user.dart 757 B

123456789101112131415161718192021222324252627282930
  1. import 'package:cloud_firestore/cloud_firestore.dart';
  2. class LoggedInUser {
  3. final String name;
  4. final num totalPoints;
  5. dynamic weeklyPlace;
  6. final String sharedId;
  7. final Timestamp lastChallengeDate;
  8. final GeoPoint address;
  9. LoggedInUser({
  10. required this.name,
  11. required this.totalPoints,
  12. required this.weeklyPlace,
  13. required this.sharedId,
  14. required this.lastChallengeDate,
  15. required this.address,
  16. });
  17. factory LoggedInUser.fromMap(Map<String, dynamic> map) {
  18. return LoggedInUser(
  19. name: map["name"],
  20. totalPoints: map["total_points"],
  21. weeklyPlace: map["weekly_place"],
  22. sharedId: map["shared_id"],
  23. lastChallengeDate: map["last_challenge_date"],
  24. address: map["address"],
  25. );
  26. }
  27. }