DatabaseManager.dart 1.2 KB

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