Selaa lähdekoodia

change writting from profileInfo to Users

David Sokol Zelazko 3 vuotta sitten
vanhempi
sitoutus
56a98ad4d6
5 muutettua tiedostoa jossa 206 lisäystä ja 29 poistoa
  1. 152 0
      app/ios/Podfile.lock
  2. 2 2
      app/lib/Services/DatabaseManager.dart
  3. 29 2
      app/lib/SignupPage.dart
  4. 12 1
      app/lib/logIn.dart
  5. 11 24
      app/lib/profilePage.dart

+ 152 - 0
app/ios/Podfile.lock

@@ -1,4 +1,11 @@
 PODS:
+  - awesome_notifications (0.0.3):
+    - Flutter
+  - body_detection (0.0.1):
+    - Flutter
+    - GoogleMLKit/PoseDetection (= 2.3.0)
+    - GoogleMLKit/PoseDetectionAccurate (= 2.3.0)
+    - GoogleMLKit/SegmentationSelfie (= 2.3.0)
   - cloud_firestore (3.1.15):
     - Firebase/Firestore (= 8.15.0)
     - firebase_core
@@ -11,6 +18,9 @@ PODS:
   - Firebase/Firestore (8.15.0):
     - Firebase/CoreOnly
     - FirebaseFirestore (~> 8.15.0)
+  - Firebase/Messaging (8.15.0):
+    - Firebase/CoreOnly
+    - FirebaseMessaging (~> 8.15.0)
   - firebase_auth (3.3.18):
     - Firebase/Auth (= 8.15.0)
     - firebase_core
@@ -18,6 +28,10 @@ PODS:
   - firebase_core (1.17.0):
     - Firebase/CoreOnly (= 8.15.0)
     - Flutter
+  - firebase_messaging (11.4.0):
+    - Firebase/Messaging (= 8.15.0)
+    - firebase_core
+    - Flutter
   - FirebaseAuth (8.15.0):
     - FirebaseCore (~> 8.0)
     - GoogleUtilities/AppDelegateSwizzler (~> 7.7)
@@ -40,7 +54,23 @@ PODS:
   - FirebaseFirestore/Base (8.15.0)
   - FirebaseFirestore/WithLeveldb (8.15.0):
     - FirebaseFirestore/Base
+  - FirebaseInstallations (8.15.0):
+    - FirebaseCore (~> 8.0)
+    - GoogleUtilities/Environment (~> 7.7)
+    - GoogleUtilities/UserDefaults (~> 7.7)
+    - PromisesObjC (< 3.0, >= 1.2)
+  - FirebaseMessaging (8.15.0):
+    - FirebaseCore (~> 8.0)
+    - FirebaseInstallations (~> 8.0)
+    - GoogleDataTransport (~> 9.1)
+    - GoogleUtilities/AppDelegateSwizzler (~> 7.7)
+    - GoogleUtilities/Environment (~> 7.7)
+    - GoogleUtilities/Reachability (~> 7.7)
+    - GoogleUtilities/UserDefaults (~> 7.7)
+    - nanopb (~> 2.30908.0)
   - Flutter (1.0.0)
+  - flutter_activity_recognition (0.0.1):
+    - Flutter
   - flutter_compass (0.0.1):
     - Flutter
   - geolocator_apple (1.2.0):
@@ -49,6 +79,29 @@ PODS:
     - GoogleUtilities/Environment (~> 7.7)
     - nanopb (< 2.30910.0, >= 2.30908.0)
     - PromisesObjC (< 3.0, >= 1.2)
+  - GoogleMLKit/MLKitCore (2.3.0):
+    - MLKitCommon (~> 3.1.0)
+  - GoogleMLKit/PoseDetection (2.3.0):
+    - GoogleMLKit/MLKitCore
+    - MLKitPoseDetection (~> 1.0.0-beta5)
+  - GoogleMLKit/PoseDetectionAccurate (2.3.0):
+    - GoogleMLKit/MLKitCore
+    - MLKitPoseDetectionAccurate (~> 1.0.0-beta5)
+  - GoogleMLKit/SegmentationSelfie (2.3.0):
+    - GoogleMLKit/MLKitCore
+    - MLKitSegmentationSelfie (~> 1.0.0-beta3)
+  - GoogleToolboxForMac/DebugUtils (2.3.2):
+    - GoogleToolboxForMac/Defines (= 2.3.2)
+  - GoogleToolboxForMac/Defines (2.3.2)
+  - GoogleToolboxForMac/Logger (2.3.2):
+    - GoogleToolboxForMac/Defines (= 2.3.2)
+  - "GoogleToolboxForMac/NSData+zlib (2.3.2)":
+    - GoogleToolboxForMac/Defines (= 2.3.2)
+  - "GoogleToolboxForMac/NSDictionary+URLArguments (2.3.2)":
+    - GoogleToolboxForMac/DebugUtils (= 2.3.2)
+    - GoogleToolboxForMac/Defines (= 2.3.2)
+    - "GoogleToolboxForMac/NSString+URLArguments (= 2.3.2)"
+  - "GoogleToolboxForMac/NSString+URLArguments (2.3.2)"
   - GoogleUtilities/AppDelegateSwizzler (7.7.0):
     - GoogleUtilities/Environment
     - GoogleUtilities/Logger
@@ -64,22 +117,73 @@ PODS:
   - "GoogleUtilities/NSData+zlib (7.7.0)"
   - GoogleUtilities/Reachability (7.7.0):
     - GoogleUtilities/Logger
+  - GoogleUtilities/UserDefaults (7.7.0):
+    - GoogleUtilities/Logger
+  - GoogleUtilitiesComponents (1.1.0):
+    - GoogleUtilities/Logger
   - GTMSessionFetcher/Core (1.7.2)
+  - location (0.0.1):
+    - Flutter
+  - MLImage (1.0.0-beta1)
+  - MLKitCommon (3.1.0):
+    - GoogleDataTransport (~> 9.0)
+    - GoogleToolboxForMac/Logger (~> 2.1)
+    - "GoogleToolboxForMac/NSData+zlib (~> 2.1)"
+    - "GoogleToolboxForMac/NSDictionary+URLArguments (~> 2.1)"
+    - GoogleUtilities/UserDefaults (~> 7.0)
+    - GoogleUtilitiesComponents (~> 1.0)
+    - GTMSessionFetcher/Core (~> 1.1)
+    - Protobuf (~> 3.12)
+  - MLKitPoseDetection (1.0.0-beta5):
+    - MLKitCommon (~> 3.1)
+    - MLKitPoseDetectionCommon (= 1.0.0-beta5)
+    - MLKitXenoCommon (= 1.0.0-beta5)
+  - MLKitPoseDetectionAccurate (1.0.0-beta5):
+    - MLKitCommon (~> 3.1)
+    - MLKitPoseDetectionCommon (= 1.0.0-beta5)
+    - MLKitXenoCommon (= 1.0.0-beta5)
+  - MLKitPoseDetectionCommon (1.0.0-beta5):
+    - MLKitCommon (~> 3.1)
+    - MLKitXenoCommon (= 1.0.0-beta5)
+  - MLKitSegmentationCommon (1.0.0-beta3):
+    - MLKitCommon (~> 3.1)
+    - MLKitXenoCommon (= 1.0.0-beta5)
+  - MLKitSegmentationSelfie (1.0.0-beta3):
+    - MLKitSegmentationCommon (= 1.0.0-beta3)
+  - MLKitVision (1.3.0):
+    - GoogleToolboxForMac/Logger (~> 2.1)
+    - "GoogleToolboxForMac/NSData+zlib (~> 2.1)"
+    - GTMSessionFetcher/Core (~> 1.1)
+    - MLImage (= 1.0.0-beta1)
+    - MLKitCommon (~> 3.0)
+    - Protobuf (~> 3.12)
+  - MLKitXenoCommon (1.0.0-beta5):
+    - MLKitCommon (~> 3.1)
+    - MLKitVision (~> 1.3)
   - nanopb (2.30908.0):
     - nanopb/decode (= 2.30908.0)
     - nanopb/encode (= 2.30908.0)
   - nanopb/decode (2.30908.0)
   - nanopb/encode (2.30908.0)
+  - permission_handler_apple (9.0.4):
+    - Flutter
   - PromisesObjC (2.1.0)
+  - Protobuf (3.21.0)
 
 DEPENDENCIES:
+  - awesome_notifications (from `.symlinks/plugins/awesome_notifications/ios`)
+  - body_detection (from `.symlinks/plugins/body_detection/ios`)
   - cloud_firestore (from `.symlinks/plugins/cloud_firestore/ios`)
   - firebase_auth (from `.symlinks/plugins/firebase_auth/ios`)
   - firebase_core (from `.symlinks/plugins/firebase_core/ios`)
+  - firebase_messaging (from `.symlinks/plugins/firebase_messaging/ios`)
   - FirebaseFirestore (from `https://github.com/invertase/firestore-ios-sdk-frameworks.git`, tag `8.15.0`)
   - Flutter (from `Flutter`)
+  - flutter_activity_recognition (from `.symlinks/plugins/flutter_activity_recognition/ios`)
   - flutter_compass (from `.symlinks/plugins/flutter_compass/ios`)
   - geolocator_apple (from `.symlinks/plugins/geolocator_apple/ios`)
+  - location (from `.symlinks/plugins/location/ios`)
+  - permission_handler_apple (from `.symlinks/plugins/permission_handler_apple/ios`)
 
 SPEC REPOS:
   trunk:
@@ -87,28 +191,55 @@ SPEC REPOS:
     - FirebaseAuth
     - FirebaseCore
     - FirebaseCoreDiagnostics
+    - FirebaseInstallations
+    - FirebaseMessaging
     - GoogleDataTransport
+    - GoogleMLKit
+    - GoogleToolboxForMac
     - GoogleUtilities
+    - GoogleUtilitiesComponents
     - GTMSessionFetcher
+    - MLImage
+    - MLKitCommon
+    - MLKitPoseDetection
+    - MLKitPoseDetectionAccurate
+    - MLKitPoseDetectionCommon
+    - MLKitSegmentationCommon
+    - MLKitSegmentationSelfie
+    - MLKitVision
+    - MLKitXenoCommon
     - nanopb
     - PromisesObjC
+    - Protobuf
 
 EXTERNAL SOURCES:
+  awesome_notifications:
+    :path: ".symlinks/plugins/awesome_notifications/ios"
+  body_detection:
+    :path: ".symlinks/plugins/body_detection/ios"
   cloud_firestore:
     :path: ".symlinks/plugins/cloud_firestore/ios"
   firebase_auth:
     :path: ".symlinks/plugins/firebase_auth/ios"
   firebase_core:
     :path: ".symlinks/plugins/firebase_core/ios"
+  firebase_messaging:
+    :path: ".symlinks/plugins/firebase_messaging/ios"
   FirebaseFirestore:
     :git: https://github.com/invertase/firestore-ios-sdk-frameworks.git
     :tag: 8.15.0
   Flutter:
     :path: Flutter
+  flutter_activity_recognition:
+    :path: ".symlinks/plugins/flutter_activity_recognition/ios"
   flutter_compass:
     :path: ".symlinks/plugins/flutter_compass/ios"
   geolocator_apple:
     :path: ".symlinks/plugins/geolocator_apple/ios"
+  location:
+    :path: ".symlinks/plugins/location/ios"
+  permission_handler_apple:
+    :path: ".symlinks/plugins/permission_handler_apple/ios"
 
 CHECKOUT OPTIONS:
   FirebaseFirestore:
@@ -116,22 +247,43 @@ CHECKOUT OPTIONS:
     :tag: 8.15.0
 
 SPEC CHECKSUMS:
+  awesome_notifications: 04530aafec8dac4635244ed4b4072f4aea6cc938
+  body_detection: ec8d077166ec7c1b092d133553ff964eaff7a45e
   cloud_firestore: 76e73835a6ac79ac825190eefd876a1e100c7835
   Firebase: 5f8193dff4b5b7c5d5ef72ae54bb76c08e2b841d
   firebase_auth: ace975b530600827bd901a9a18584f7cdaf6d160
   firebase_core: aa1b92020533f5c23955e388c347c58fd64f8627
+  firebase_messaging: 8957bf304b47daf8bf12d0b111fdecc5b33e77a3
   FirebaseAuth: 3e73bf8abf4fbb40f8b421f361f4cc48ee57388c
   FirebaseCore: 5743c5785c074a794d35f2fff7ecc254a91e08b1
   FirebaseCoreDiagnostics: 92e07a649aeb66352b319d43bdd2ee3942af84cb
   FirebaseFirestore: cb361b7f8f225a225c9f11b8d42066baebb1630c
+  FirebaseInstallations: 40bd9054049b2eae9a2c38ef1c3dd213df3605cd
+  FirebaseMessaging: 5e5118a2383b3531e730d974680954c679ca0a13
   Flutter: 50d75fe2f02b26cc09d224853bb45737f8b3214a
+  flutter_activity_recognition: 5c3b026997742b01e82424ef257db9640822ad77
   flutter_compass: cbbd285cea1584c7ac9c4e0c3e1f17cbea55e855
   geolocator_apple: cc556e6844d508c95df1e87e3ea6fa4e58c50401
   GoogleDataTransport: 5fffe35792f8b96ec8d6775f5eccd83c998d5a3b
+  GoogleMLKit: 53d5adbee0fe5a701e970f1387d2cfececd5bc50
+  GoogleToolboxForMac: 8bef7c7c5cf7291c687cf5354f39f9db6399ad34
   GoogleUtilities: e0913149f6b0625b553d70dae12b49fc62914fd1
+  GoogleUtilitiesComponents: 679b2c881db3b615a2777504623df6122dd20afe
   GTMSessionFetcher: 5595ec75acf5be50814f81e9189490412bad82ba
+  location: 3a2eed4dd2fab25e7b7baf2a9efefe82b512d740
+  MLImage: 647f3d580c10b3c9a3f6154f5d7baead60c42a0c
+  MLKitCommon: 1b5c79d52f79d9cc93ab5300e9713c4c215121ea
+  MLKitPoseDetection: d678a95ca0af6658f3539bf64b499e336fa99249
+  MLKitPoseDetectionAccurate: ea4d937dcc4ad5862c1c7157dcfd2141d0545412
+  MLKitPoseDetectionCommon: f3465bba3561e2f12cf4e80ce04e8eb0784ab30b
+  MLKitSegmentationCommon: 28c095b2c026e76087b6ea8dcd0a6a79fc4457c2
+  MLKitSegmentationSelfie: 83537a445fcc3def829852a5b6724f42f328751d
+  MLKitVision: 26da299aef93291f24f5200e8372919f73abf3b5
+  MLKitXenoCommon: 34fc24339d4ad1a3b0b0973fae18987f60802984
   nanopb: a0ba3315591a9ae0a16a309ee504766e90db0c96
+  permission_handler_apple: 44366e37eaf29454a1e7b1b7d736c2cceaeb17ce
   PromisesObjC: 99b6f43f9e1044bd87a95a60beff28c2c44ddb72
+  Protobuf: a205ef72105f3f024786a06589f1ca54b70265c4
 
 PODFILE CHECKSUM: f99a294491bb4a8b0ed5ee7ec97f8c8001a75c19
 

+ 2 - 2
app/lib/Services/DatabaseManager.dart

@@ -5,7 +5,7 @@ class DatabaseManager {
   late final String points;
   final CollectionReference profileList =
   FirebaseFirestore.instance.collection('profileInfo');
-  CollectionReference usersList =
+  final CollectionReference usersList =
   FirebaseFirestore.instance.collection("Users");
 
   DatabaseManager(this.points);
@@ -25,7 +25,7 @@ class DatabaseManager {
       String weeklyplace,
       String uid) async {
     print('----------- ' + uid);
-    return await profileList.doc(uid).set({
+    return await usersList.doc(uid).set({
       'address': address,
       'anonymous': anonymous,
       'birth_date': birth_date,

+ 29 - 2
app/lib/SignupPage.dart

@@ -279,9 +279,36 @@ class _SignupForm3 extends State<SignupForm3> {
                 try {
                   if (_passwd.text == _passwd2.text) {
                     createUser();
-                    Navigator.pop(context);
+                    showDialog<String>(
+                        context: context,
+                        builder: (BuildContext context) => AlertDialog(
+                          title: const Text('Sign Up - Information'),
+                          content: const Text('The account was created successfully'),
+                          actions: <Widget>[
+                            TextButton(
+                              onPressed: () => {
+                                Navigator.pop(context, 'OK'),
+                                Navigator.pop(context)
+                              },
+                              child: const Text('OK'),
+                            ),
+                          ],
+                        ));
+
+
                   } else {
-                    print("passwd is not the same");
+                    showDialog<String>(
+                        context: context,
+                        builder: (BuildContext context) => AlertDialog(
+                          title: const Text('Sign Up - Error'),
+                          content: const Text('Passwords are not the same'),
+                          actions: <Widget>[
+                            TextButton(
+                              onPressed: () => Navigator.pop(context, 'OK'),
+                              child: const Text('OK'),
+                            ),
+                          ],
+                        ));
                   }
                 } catch (e) {
                   print(e.toString());

+ 12 - 1
app/lib/logIn.dart

@@ -67,7 +67,18 @@ class _LogIn extends State<LogIn> {
   void signInUser() async {
     dynamic authResult = await AuthenticationServices.loginUser(_email.text, _passwd.text);
     if (authResult == null) {
-      print("log in error");
+      showDialog<String>(
+          context: context,
+          builder: (BuildContext context) => AlertDialog(
+            title: const Text('Log In - Error'),
+            content: const Text('User or password are not correct'),
+            actions: <Widget>[
+              TextButton(
+                onPressed: () => Navigator.pop(context, 'OK'),
+                child: const Text('OK'),
+              ),
+            ],
+          ));
     } else {
       _email.clear();
       _passwd.clear();

+ 11 - 24
app/lib/profilePage.dart

@@ -14,43 +14,29 @@ class _ProfilePage extends State<ProfilePage> {
   String name = '', surname = '', birth_date = '', mail = '', shared_id = '',
       phone_number = '', anonymous = '', address = '';
 
+
+
+  @override
+  void initState() {
+    super.initState();
+  }
+
+
+
   @override
   Widget build(BuildContext context) {
     final arguments = (ModalRoute.of(context)?.settings.arguments ??
         <String, dynamic>{}) as Map;
-    print('******' + arguments['id']);
 
-    //getting info of the user one by one
-    FirebaseFirestore.instance.collection('profileInfo').doc(arguments['id'])
+    FirebaseFirestore.instance.collection('Users').doc(arguments['id'])
         .get().then((DocumentSnapshot) {
       name = DocumentSnapshot.get('name').toString();
-    });
-    FirebaseFirestore.instance.collection('profileInfo').doc(arguments['id'])
-        .get().then((DocumentSnapshot) {
       surname = DocumentSnapshot.get('surname').toString();
-    });
-    FirebaseFirestore.instance.collection('profileInfo').doc(arguments['id'])
-        .get().then((DocumentSnapshot) {
       birth_date = DocumentSnapshot.get('birth_date').toString();
-    });
-    FirebaseFirestore.instance.collection('profileInfo').doc(arguments['id'])
-        .get().then((DocumentSnapshot) {
       mail = DocumentSnapshot.get('mail').toString();
-    });
-    FirebaseFirestore.instance.collection('profileInfo').doc(arguments['id'])
-        .get().then((DocumentSnapshot) {
       shared_id = DocumentSnapshot.get('shared_id').toString();
-    });
-    FirebaseFirestore.instance.collection('profileInfo').doc(arguments['id'])
-        .get().then((DocumentSnapshot) {
       phone_number = DocumentSnapshot.get('phone_number').toString();
-    });
-    FirebaseFirestore.instance.collection('profileInfo').doc(arguments['id'])
-        .get().then((DocumentSnapshot) {
       anonymous = DocumentSnapshot.get('anonymous').toString();
-    });
-    FirebaseFirestore.instance.collection('profileInfo').doc(arguments['id'])
-        .get().then((DocumentSnapshot) {
       address = DocumentSnapshot.get('address').toString();
     });
 
@@ -98,4 +84,5 @@ class _ProfilePage extends State<ProfilePage> {
       ),
     );
   }
+
 }