DatabaseManager.dart 1021 B

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