diff --git a/fude_app/ios/Podfile.lock b/fude_app/ios/Podfile.lock index 3a8b091..4d70d85 100644 --- a/fude_app/ios/Podfile.lock +++ b/fude_app/ios/Podfile.lock @@ -148,7 +148,7 @@ DEPENDENCIES: - firebase_auth (from `.symlinks/plugins/firebase_auth/ios`) - firebase_core (from `.symlinks/plugins/firebase_core/ios`) - firebase_storage (from `.symlinks/plugins/firebase_storage/ios`) - - Flutter (from `.symlinks/flutter/ios-release`) + - Flutter (from `.symlinks/flutter/ios`) - image_picker (from `.symlinks/plugins/image_picker/ios`) - shared_preferences (from `.symlinks/plugins/shared_preferences/ios`) - url_launcher (from `.symlinks/plugins/url_launcher/ios`) @@ -186,7 +186,7 @@ EXTERNAL SOURCES: firebase_storage: :path: ".symlinks/plugins/firebase_storage/ios" Flutter: - :path: ".symlinks/flutter/ios-release" + :path: ".symlinks/flutter/ios" image_picker: :path: ".symlinks/plugins/image_picker/ios" shared_preferences: diff --git a/fude_app/ios/Runner.xcodeproj/project.pbxproj b/fude_app/ios/Runner.xcodeproj/project.pbxproj index d01fc9e..d17ecb0 100644 --- a/fude_app/ios/Runner.xcodeproj/project.pbxproj +++ b/fude_app/ios/Runner.xcodeproj/project.pbxproj @@ -252,7 +252,7 @@ ); inputPaths = ( "${SRCROOT}/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh", - "${PODS_ROOT}/../.symlinks/flutter/ios-release/Flutter.framework", + "${PODS_ROOT}/../.symlinks/flutter/ios/Flutter.framework", ); name = "[CP] Embed Pods Frameworks"; outputFileListPaths = ( diff --git a/fude_app/lib/helpers/randomNoteModal.dart b/fude_app/lib/helpers/randomNoteModal.dart index 03d027f..e66f1e9 100644 --- a/fude_app/lib/helpers/randomNoteModal.dart +++ b/fude_app/lib/helpers/randomNoteModal.dart @@ -19,7 +19,7 @@ void showRandomNote(BuildContext context, DocumentSnapshot randomNote, child: AlertDialog( shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(30)), - contentPadding: EdgeInsets.all(0), + contentPadding: EdgeInsets.all(2.5), content: ClipRRect( borderRadius: BorderRadius.circular(30), child: Container( @@ -65,9 +65,9 @@ void showRandomNote(BuildContext context, DocumentSnapshot randomNote, ? Expanded( child: Center( child: Text( - "You don't have any $category ideas yet.", + category == 'ALL' ? "You still need to add some ideas to this jar!" : "You don't have any ideas in this category yet!", textAlign: TextAlign.center, - overflow: TextOverflow.fade, + overflow: TextOverflow.clip, style: TextStyle( color: Theme.of(context).primaryColor == Color.fromRGBO(40, 40, 40, 1) @@ -75,7 +75,7 @@ void showRandomNote(BuildContext context, DocumentSnapshot randomNote, : Color.fromRGBO(40, 40, 40, 1), fontWeight: FontWeight.bold, fontSize: 20, - letterSpacing: 3, + letterSpacing: 1, ), ), ), diff --git a/fude_app/lib/pages/jars/jar.dart b/fude_app/lib/pages/jars/jar.dart index cfa8b8f..ecf52e4 100644 --- a/fude_app/lib/pages/jars/jar.dart +++ b/fude_app/lib/pages/jars/jar.dart @@ -266,7 +266,7 @@ class _JarPageState extends State { child: Column( children: [ Text( - 'SELECT A CATEGORY', + 'TAP A CATEGORY TO', style: TextStyle( color: Theme.of(context) .secondaryHeaderColor, @@ -280,7 +280,7 @@ class _JarPageState extends State { height: height * 0.01, ), Text( - 'TO PULL A RANDOM IDEA', + 'PULL A RANDOM IDEA', style: TextStyle( color: Theme.of(context) .secondaryHeaderColor, diff --git a/fude_app/lib/pages/jars/jar_edit.dart b/fude_app/lib/pages/jars/jar_edit.dart index a77a4d0..491880c 100644 --- a/fude_app/lib/pages/jars/jar_edit.dart +++ b/fude_app/lib/pages/jars/jar_edit.dart @@ -25,7 +25,6 @@ class _JarPageState extends State { final GlobalKey formKey = GlobalKey(); final GlobalKey addUserFormKey = GlobalKey(); int categoryCount = 0; - bool needsAtLeastOneCategory = false; List currentCategories = []; bool userHasBeenAdded = false; bool needToInviteThisUser = false; @@ -48,7 +47,7 @@ class _JarPageState extends State { void updateJar(MainModel model) { //validate form. - if (!this.formKey.currentState.validate() || needsAtLeastOneCategory) { + if (!this.formKey.currentState.validate()) { return; } else { formKey.currentState.save(); @@ -80,16 +79,12 @@ class _JarPageState extends State { void updateCategoryCount() { setState(() { categoryCount += 1; - needsAtLeastOneCategory = false; }); } void addCategoryToRemoveList(String category) { _formData['categoriesToRemove'].add(category); setState(() { - if (currentCategories.length == 1 && categoryCount == 0) { - needsAtLeastOneCategory = true; - } currentCategories.removeWhere((val) => val == category); }); } @@ -191,7 +186,6 @@ class _JarPageState extends State { jar: model.selectedJar, addCategoryToRemoveList: addCategoryToRemoveList, categories: currentCategories, - needsAtLeastOneCategory: needsAtLeastOneCategory, updateCategory: updateCategory, updateTitle: updateTitle, updateImage: updateImage, diff --git a/fude_app/lib/scoped-models/jar.dart b/fude_app/lib/scoped-models/jar.dart index be392e9..6bce7ab 100644 --- a/fude_app/lib/scoped-models/jar.dart +++ b/fude_app/lib/scoped-models/jar.dart @@ -52,6 +52,8 @@ mixin JarModel on Model { notifyListeners(); CollectionReference jarCollection = _firestore.collection('jars'); String imageLocation; + data['categories'].add('ALL'); + try { if (data['image'] != null) { imageLocation = await uploadJarImageToStorage(data['image']); @@ -361,11 +363,17 @@ mixin JarModel on Model { print(e); } if (notes.documents.length > 0) { - notes.documents.forEach((doc) { - if (doc.data['category'] == category) { + if (category == 'ALL') { + notes.documents.forEach((doc) { _jarNotesByCategory.add(doc); - } - }); + }); + } else { + notes.documents.forEach((doc) { + if (doc.data['category'] == category) { + _jarNotesByCategory.add(doc); + } + }); + } } else { return null; } diff --git a/fude_app/lib/widgets/form-inputs/add_jar_category_input.dart b/fude_app/lib/widgets/form-inputs/add_jar_category_input.dart index 35601c8..8e1add9 100644 --- a/fude_app/lib/widgets/form-inputs/add_jar_category_input.dart +++ b/fude_app/lib/widgets/form-inputs/add_jar_category_input.dart @@ -5,7 +5,6 @@ import 'package:fude/scoped-models/main.dart'; class AddJarCategoryField extends StatelessWidget { final String hint; final bool enabled; - final bool needsAtLeastOneCategory; final Function updateCategory; final Function addCategoryToRemoveList; final MainModel model; @@ -14,7 +13,6 @@ class AddJarCategoryField extends StatelessWidget { AddJarCategoryField( {this.hint, this.enabled, - this.needsAtLeastOneCategory, this.updateCategory, this.addCategoryToRemoveList, this.model, @@ -24,7 +22,7 @@ class AddJarCategoryField extends StatelessWidget { final double height = MediaQuery.of(context).size.height; final double width = MediaQuery.of(context).size.width; return GestureDetector( - onLongPress: () => addCategoryToRemoveList(hint), + onLongPress: () => hint != 'ALL' ? addCategoryToRemoveList(hint) : print("you can't delete the all category"), child: Card( color: Theme.of(context).cardColor, elevation: 6.0, @@ -62,8 +60,7 @@ class AddJarCategoryField extends StatelessWidget { ), validator: (String val) { String finalVal = val.trim(); - if (needsAtLeastOneCategory == true || - finalVal.isEmpty && categories.length < 1) { + if (finalVal.isEmpty) { return 'cannot be blank'; } }, diff --git a/fude_app/lib/widgets/forms/add_jar.dart b/fude_app/lib/widgets/forms/add_jar.dart index d5bd7b8..ea0c4cd 100644 --- a/fude_app/lib/widgets/forms/add_jar.dart +++ b/fude_app/lib/widgets/forms/add_jar.dart @@ -72,7 +72,6 @@ class AddJarForm extends StatelessWidget { model: model, enabled: true, categories: categories, - needsAtLeastOneCategory: needsAtLeastOneCategory ), ], ), diff --git a/fude_app/lib/widgets/forms/edit_jar.dart b/fude_app/lib/widgets/forms/edit_jar.dart index 088548f..83d7bb1 100644 --- a/fude_app/lib/widgets/forms/edit_jar.dart +++ b/fude_app/lib/widgets/forms/edit_jar.dart @@ -11,7 +11,6 @@ class EditJarForm extends StatelessWidget { final MainModel model; final List categories; final int categoryCount; - final bool needsAtLeastOneCategory; final Function updateTitle; final Function updateCategory; final Function updateImage; @@ -25,7 +24,6 @@ class EditJarForm extends StatelessWidget { this.categories, this.jar, this.categoryCount, - this.needsAtLeastOneCategory, this.updateTitle, this.updateCategory, this.addCategoryToRemoveList, @@ -74,13 +72,12 @@ class EditJarForm extends StatelessWidget { updateCategory: updateCategory, enabled: false, addCategoryToRemoveList: addCategoryToRemoveList, - needsAtLeastOneCategory: needsAtLeastOneCategory, ), - Text( + categories[i] != 'ALL' ? Text( 'Tap and hold to delete', style: TextStyle( color: Color.fromRGBO(131, 129, 129, 1), fontSize: 12), - ) + ) : Container() ], ), ); @@ -130,13 +127,6 @@ class EditJarForm extends StatelessWidget { ), SizedBox(height: height * 0.03), _buildFormTitles("CATEGORIES", context), - needsAtLeastOneCategory - ? Text( - 'Please keep at least one category', - style: TextStyle(color: Colors.red), - textAlign: TextAlign.start, - ) - : Container(), SizedBox(height: height * 0.01), _buildExistingCategoryInputs(context), Column(