DatabaseManager.dart 1.4 KB

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