diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index ead90f8..ab26858 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -439,6 +439,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; @@ -561,6 +562,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; @@ -616,6 +618,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; diff --git a/lib/cloud_io/firestore_sync.dart b/lib/cloud_io/firestore_sync.dart index 5a9bbd8..8da092a 100644 --- a/lib/cloud_io/firestore_sync.dart +++ b/lib/cloud_io/firestore_sync.dart @@ -1,5 +1,4 @@ import 'dart:async'; - import 'package:cloud_firestore/cloud_firestore.dart'; import 'package:firebase_auth/firebase_auth.dart'; import 'package:open_fitness_tracker/DOM/training_metadata.dart'; @@ -18,7 +17,6 @@ class MyStorage { CollectionReference users = firestore.collection('users'); DocumentReference userDoc = users.doc(FirebaseAuth.instance.currentUser!.uid); await userDoc.collection(historyKey).add(session.toJson()); - print("geh"); } catch (e) { print("Error adding session to history: $e"); } diff --git a/lib/history/history_page.dart b/lib/history/history_page.dart index 42e2b8b..4c6c297 100644 --- a/lib/history/history_page.dart +++ b/lib/history/history_page.dart @@ -8,7 +8,6 @@ import 'package:open_fitness_tracker/cloud_io/firestore_sync.dart'; import 'package:open_fitness_tracker/common/common_widgets.dart'; import 'package:open_fitness_tracker/history/import_training_dialog.dart'; import 'package:open_fitness_tracker/utils/utils.dart'; -import 'package:cloud_firestore/cloud_firestore.dart'; //todo when new history syncs in, the page needs to be updated to reflect the new data! // we should be listening to state changes on firebase @@ -117,7 +116,7 @@ class _HistoryPageState extends State { width: 300, height: 300, decoration: BoxDecoration(color: Colors.blue[300]), - child: CircularProgressIndicator(), + child: const CircularProgressIndicator(), )); } else { return Container(); diff --git a/lib/main.dart b/lib/main.dart index 4c34f75..35f1bf6 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -40,40 +40,40 @@ class MyApp extends StatefulWidget { } class _MyAppState extends State { - _myAsyncMethod() async { - var ff = FirebaseFirestore.instance; - final user = {"first": "Adaa", "last": "Lovelace", "born": 1815}; - await ff.collection("users").get().then((event) { - for (var doc in event.docs) { - print("${doc.id} => ${doc.data()}"); - } - }); - // Add a new document with a generated ID - ff - .collection("users") - .add(user) - .then((DocumentReference doc) => print('DocumentSnapshot added with ID: ${doc.id}')); + // _myAsyncMethod() async { + // var ff = FirebaseFirestore.instance; + // final user = {"first": "hmm!", "last": "Lovelace", "born": 1815}; + // // await ff.collection("users").get().then((event) { + // // for (var doc in event.docs) { + // // print("${doc.id} => ${doc.data()}"); + // // } + // // }); + // // Add a new document with a generated ID + // ff + // .collection("users") + // .add(user) + // .then((DocumentReference doc) => print('DocumentSnapshot added with ID: ${doc.id}')); - var usrCollection = ff.collection('users'); - var athing = await usrCollection.get(); + // var usrCollection = ff.collection('users'); + // // var athing = await usrCollection.get(); - // await usrCollection.add({"aoeu": "sth"}); - var usrdoc = usrCollection.doc("0qYo6ihSKsh8s6dsLksQ2N6WLek2"); - await usrdoc.set({"buttt": "stuff"}); //, SetOptions()); - try { - var newcol = usrdoc.collection("newcol"); - await newcol.add({"akey": "aval"}); - } catch (e) { - print('crap'); - } - print("object"); - } + // // await usrCollection.add({"aoeu": "sth"}); + // var usrdoc = usrCollection.doc("0qYo6ihSKsh8s6dsLksQ2N6WLek2"); + // await usrdoc.set({"buttttX new": "stuff"}); //, SetOptions()); + // try { + // var newcol = usrdoc.collection("newcol"); + // await newcol.add({"akey": "aval"}); + // } catch (e) { + // print('crap'); + // } + // print("object"); + // } - @override - void initState() { - super.initState(); - _myAsyncMethod(); - } + // @override + // void initState() { + // super.initState(); + // _myAsyncMethod(); + // } @override Widget build(BuildContext context) {