DatabaseManager.dart 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. import 'package:cloud_firestore/cloud_firestore.dart';
  2. class DatabaseManager {
  3. late final String points;
  4. final CollectionReference profileList =
  5. FirebaseFirestore.instance.collection('profileInfo');
  6. CollectionReference usersList =
  7. FirebaseFirestore.instance.collection("Users");
  8. DatabaseManager(this.points);
  9. Future<void> createUserData(String address,
  10. bool anonymous,
  11. String birth_date,
  12. DateTime create_date,
  13. DateTime lastChallengeDate,
  14. String mail,
  15. String name,
  16. String phoneNumber,
  17. String shared_id,
  18. String surname,
  19. int totalpoints,
  20. DateTime updated_date,
  21. String weeklyplace,
  22. String uid) async {
  23. return await profileList.doc(uid).set({
  24. 'address': address,
  25. 'anonymous': anonymous,
  26. 'birth_date': birth_date,
  27. 'created_date': create_date,
  28. 'last_challenge_date': lastChallengeDate,
  29. 'mail': mail,
  30. 'name': name,
  31. 'phone_number': phoneNumber,
  32. 'shared_id': shared_id,
  33. 'surname': surname,
  34. 'total_points': totalpoints,
  35. 'updated_date': updated_date,
  36. 'weekly_place': weeklyplace,
  37. });
  38. }
  39. }