From c40e3079c1e2431fe0ad62a1f8686aceac52b716 Mon Sep 17 00:00:00 2001 From: sbcsu <74089858+crispylemons@users.noreply.github.com> Date: Tue, 29 Apr 2025 16:46:49 -0700 Subject: [PATCH] page ui's updated without api --- .../arm64-v8a/configure_fingerprint.bin | 24 +- .../armeabi-v7a/configure_fingerprint.bin | 24 +- .../4u62201l/x86/configure_fingerprint.bin | 24 +- .../4u62201l/x86_64/configure_fingerprint.bin | 24 +- lib/main.dart | 5 +- lib/pages/explore.dart | 154 ++----- lib/pages/matches.dart | 54 --- lib/pages/myprofile.dart | 417 ++++++++---------- lib/pages/settings.dart | 2 +- 9 files changed, 267 insertions(+), 461 deletions(-) diff --git a/android/app/.cxx/Debug/4u62201l/arm64-v8a/configure_fingerprint.bin b/android/app/.cxx/Debug/4u62201l/arm64-v8a/configure_fingerprint.bin index 7abc2bf..b274e95 100644 --- a/android/app/.cxx/Debug/4u62201l/arm64-v8a/configure_fingerprint.bin +++ b/android/app/.cxx/Debug/4u62201l/arm64-v8a/configure_fingerprint.bin @@ -2,27 +2,27 @@ C/C++ Structured Log  C:\Users\Sage Becker\OneDrive\Desktop\gp\active\archenemy-updated\android\app\.cxx\Debug\4u62201l\arm64-v8a\additional_project_files.txtC A -?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint  2  ۯ2 +?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint  Õ2  ۯ2  -C:\Users\Sage Becker\OneDrive\Desktop\gp\active\archenemy-updated\android\app\.cxx\Debug\4u62201l\arm64-v8a\android_gradle_build.json  2 ۯ2 +C:\Users\Sage Becker\OneDrive\Desktop\gp\active\archenemy-updated\android\app\.cxx\Debug\4u62201l\arm64-v8a\android_gradle_build.json  Õ2 ۯ2  -C:\Users\Sage Becker\OneDrive\Desktop\gp\active\archenemy-updated\android\app\.cxx\Debug\4u62201l\arm64-v8a\android_gradle_build_mini.json  2 ۯ2{ +C:\Users\Sage Becker\OneDrive\Desktop\gp\active\archenemy-updated\android\app\.cxx\Debug\4u62201l\arm64-v8a\android_gradle_build_mini.json  Õ2 ۯ2{ y -wC:\Users\Sage Becker\OneDrive\Desktop\gp\active\archenemy-updated\android\app\.cxx\Debug\4u62201l\arm64-v8a\build.ninja  2 ۯ2 +wC:\Users\Sage Becker\OneDrive\Desktop\gp\active\archenemy-updated\android\app\.cxx\Debug\4u62201l\arm64-v8a\build.ninja  Õ2 ۯ2 } -{C:\Users\Sage Becker\OneDrive\Desktop\gp\active\archenemy-updated\android\app\.cxx\Debug\4u62201l\arm64-v8a\build.ninja.txt  2 +{C:\Users\Sage Becker\OneDrive\Desktop\gp\active\archenemy-updated\android\app\.cxx\Debug\4u62201l\arm64-v8a\build.ninja.txt  Õ2  -C:\Users\Sage Becker\OneDrive\Desktop\gp\active\archenemy-updated\android\app\.cxx\Debug\4u62201l\arm64-v8a\build_file_index.txt  2 K ۯ2 +C:\Users\Sage Becker\OneDrive\Desktop\gp\active\archenemy-updated\android\app\.cxx\Debug\4u62201l\arm64-v8a\build_file_index.txt  Õ2 K ۯ2  -C:\Users\Sage Becker\OneDrive\Desktop\gp\active\archenemy-updated\android\app\.cxx\Debug\4u62201l\arm64-v8a\compile_commands.json  2 +C:\Users\Sage Becker\OneDrive\Desktop\gp\active\archenemy-updated\android\app\.cxx\Debug\4u62201l\arm64-v8a\compile_commands.json  Õ2  -C:\Users\Sage Becker\OneDrive\Desktop\gp\active\archenemy-updated\android\app\.cxx\Debug\4u62201l\arm64-v8a\compile_commands.json.bin  2  +C:\Users\Sage Becker\OneDrive\Desktop\gp\active\archenemy-updated\android\app\.cxx\Debug\4u62201l\arm64-v8a\compile_commands.json.bin  Õ2   -C:\Users\Sage Becker\OneDrive\Desktop\gp\active\archenemy-updated\android\app\.cxx\Debug\4u62201l\arm64-v8a\metadata_generation_command.txt  2 +C:\Users\Sage Becker\OneDrive\Desktop\gp\active\archenemy-updated\android\app\.cxx\Debug\4u62201l\arm64-v8a\metadata_generation_command.txt  Õ2  ۯ2  -~C:\Users\Sage Becker\OneDrive\Desktop\gp\active\archenemy-updated\android\app\.cxx\Debug\4u62201l\arm64-v8a\prefab_config.json  2  ( ۯ2 +~C:\Users\Sage Becker\OneDrive\Desktop\gp\active\archenemy-updated\android\app\.cxx\Debug\4u62201l\arm64-v8a\prefab_config.json  Õ2  ( ۯ2  -C:\Users\Sage Becker\OneDrive\Desktop\gp\active\archenemy-updated\android\app\.cxx\Debug\4u62201l\arm64-v8a\symbol_folder_index.txt  2  z ۯ2O +C:\Users\Sage Becker\OneDrive\Desktop\gp\active\archenemy-updated\android\app\.cxx\Debug\4u62201l\arm64-v8a\symbol_folder_index.txt  Õ2  z ۯ2O M -KC:\dev\flutter\packages\flutter_tools\gradle\src\main\groovy\CMakeLists.txt  2  ͒2 \ No newline at end of file +KC:\dev\flutter\packages\flutter_tools\gradle\src\main\groovy\CMakeLists.txt  Õ2  ͒2 \ No newline at end of file diff --git a/android/app/.cxx/Debug/4u62201l/armeabi-v7a/configure_fingerprint.bin b/android/app/.cxx/Debug/4u62201l/armeabi-v7a/configure_fingerprint.bin index 816f08a..b970d4f 100644 --- a/android/app/.cxx/Debug/4u62201l/armeabi-v7a/configure_fingerprint.bin +++ b/android/app/.cxx/Debug/4u62201l/armeabi-v7a/configure_fingerprint.bin @@ -2,27 +2,27 @@ C/C++ Structured Log  C:\Users\Sage Becker\OneDrive\Desktop\gp\active\archenemy-updated\android\app\.cxx\Debug\4u62201l\armeabi-v7a\additional_project_files.txtC A -?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint  2  ܯ2 +?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint  Õ2  ܯ2  -C:\Users\Sage Becker\OneDrive\Desktop\gp\active\archenemy-updated\android\app\.cxx\Debug\4u62201l\armeabi-v7a\android_gradle_build.json  2 ܯ2 +C:\Users\Sage Becker\OneDrive\Desktop\gp\active\archenemy-updated\android\app\.cxx\Debug\4u62201l\armeabi-v7a\android_gradle_build.json  Õ2 ܯ2  -C:\Users\Sage Becker\OneDrive\Desktop\gp\active\archenemy-updated\android\app\.cxx\Debug\4u62201l\armeabi-v7a\android_gradle_build_mini.json  2 ܯ2} +C:\Users\Sage Becker\OneDrive\Desktop\gp\active\archenemy-updated\android\app\.cxx\Debug\4u62201l\armeabi-v7a\android_gradle_build_mini.json  Õ2 ܯ2} { -yC:\Users\Sage Becker\OneDrive\Desktop\gp\active\archenemy-updated\android\app\.cxx\Debug\4u62201l\armeabi-v7a\build.ninja  2 ܯ2 +yC:\Users\Sage Becker\OneDrive\Desktop\gp\active\archenemy-updated\android\app\.cxx\Debug\4u62201l\armeabi-v7a\build.ninja  Õ2 ܯ2  -}C:\Users\Sage Becker\OneDrive\Desktop\gp\active\archenemy-updated\android\app\.cxx\Debug\4u62201l\armeabi-v7a\build.ninja.txt  2 +}C:\Users\Sage Becker\OneDrive\Desktop\gp\active\archenemy-updated\android\app\.cxx\Debug\4u62201l\armeabi-v7a\build.ninja.txt  Õ2  -C:\Users\Sage Becker\OneDrive\Desktop\gp\active\archenemy-updated\android\app\.cxx\Debug\4u62201l\armeabi-v7a\build_file_index.txt  2 K ܯ2 +C:\Users\Sage Becker\OneDrive\Desktop\gp\active\archenemy-updated\android\app\.cxx\Debug\4u62201l\armeabi-v7a\build_file_index.txt  Õ2 K ܯ2  -C:\Users\Sage Becker\OneDrive\Desktop\gp\active\archenemy-updated\android\app\.cxx\Debug\4u62201l\armeabi-v7a\compile_commands.json  2 +C:\Users\Sage Becker\OneDrive\Desktop\gp\active\archenemy-updated\android\app\.cxx\Debug\4u62201l\armeabi-v7a\compile_commands.json  Õ2  -C:\Users\Sage Becker\OneDrive\Desktop\gp\active\archenemy-updated\android\app\.cxx\Debug\4u62201l\armeabi-v7a\compile_commands.json.bin  2  +C:\Users\Sage Becker\OneDrive\Desktop\gp\active\archenemy-updated\android\app\.cxx\Debug\4u62201l\armeabi-v7a\compile_commands.json.bin  Õ2   -C:\Users\Sage Becker\OneDrive\Desktop\gp\active\archenemy-updated\android\app\.cxx\Debug\4u62201l\armeabi-v7a\metadata_generation_command.txt  2 +C:\Users\Sage Becker\OneDrive\Desktop\gp\active\archenemy-updated\android\app\.cxx\Debug\4u62201l\armeabi-v7a\metadata_generation_command.txt  Õ2  ܯ2  -C:\Users\Sage Becker\OneDrive\Desktop\gp\active\archenemy-updated\android\app\.cxx\Debug\4u62201l\armeabi-v7a\prefab_config.json  2  ( ܯ2 +C:\Users\Sage Becker\OneDrive\Desktop\gp\active\archenemy-updated\android\app\.cxx\Debug\4u62201l\armeabi-v7a\prefab_config.json  Õ2  ( ܯ2  -C:\Users\Sage Becker\OneDrive\Desktop\gp\active\archenemy-updated\android\app\.cxx\Debug\4u62201l\armeabi-v7a\symbol_folder_index.txt  2  | ܯ2O +C:\Users\Sage Becker\OneDrive\Desktop\gp\active\archenemy-updated\android\app\.cxx\Debug\4u62201l\armeabi-v7a\symbol_folder_index.txt  Õ2  | ܯ2O M -KC:\dev\flutter\packages\flutter_tools\gradle\src\main\groovy\CMakeLists.txt  2  ͒2 \ No newline at end of file +KC:\dev\flutter\packages\flutter_tools\gradle\src\main\groovy\CMakeLists.txt  Õ2  ͒2 \ No newline at end of file diff --git a/android/app/.cxx/Debug/4u62201l/x86/configure_fingerprint.bin b/android/app/.cxx/Debug/4u62201l/x86/configure_fingerprint.bin index 29337c0..71da864 100644 --- a/android/app/.cxx/Debug/4u62201l/x86/configure_fingerprint.bin +++ b/android/app/.cxx/Debug/4u62201l/x86/configure_fingerprint.bin @@ -2,27 +2,27 @@ C/C++ Structured Log  C:\Users\Sage Becker\OneDrive\Desktop\gp\active\archenemy-updated\android\app\.cxx\Debug\4u62201l\x86\additional_project_files.txtC A -?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint  2  ܯ2 +?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint  Õ2  ܯ2  -C:\Users\Sage Becker\OneDrive\Desktop\gp\active\archenemy-updated\android\app\.cxx\Debug\4u62201l\x86\android_gradle_build.json  2 ܯ2 +C:\Users\Sage Becker\OneDrive\Desktop\gp\active\archenemy-updated\android\app\.cxx\Debug\4u62201l\x86\android_gradle_build.json  Õ2 ܯ2  -C:\Users\Sage Becker\OneDrive\Desktop\gp\active\archenemy-updated\android\app\.cxx\Debug\4u62201l\x86\android_gradle_build_mini.json  2 ܯ2u +C:\Users\Sage Becker\OneDrive\Desktop\gp\active\archenemy-updated\android\app\.cxx\Debug\4u62201l\x86\android_gradle_build_mini.json  Õ2 ܯ2u s -qC:\Users\Sage Becker\OneDrive\Desktop\gp\active\archenemy-updated\android\app\.cxx\Debug\4u62201l\x86\build.ninja  2 ܯ2y +qC:\Users\Sage Becker\OneDrive\Desktop\gp\active\archenemy-updated\android\app\.cxx\Debug\4u62201l\x86\build.ninja  Õ2 ܯ2y w -uC:\Users\Sage Becker\OneDrive\Desktop\gp\active\archenemy-updated\android\app\.cxx\Debug\4u62201l\x86\build.ninja.txt  2~ +uC:\Users\Sage Becker\OneDrive\Desktop\gp\active\archenemy-updated\android\app\.cxx\Debug\4u62201l\x86\build.ninja.txt  Õ2~ | -zC:\Users\Sage Becker\OneDrive\Desktop\gp\active\archenemy-updated\android\app\.cxx\Debug\4u62201l\x86\build_file_index.txt  2 K ܯ2 +zC:\Users\Sage Becker\OneDrive\Desktop\gp\active\archenemy-updated\android\app\.cxx\Debug\4u62201l\x86\build_file_index.txt  Õ2 K ܯ2 } -{C:\Users\Sage Becker\OneDrive\Desktop\gp\active\archenemy-updated\android\app\.cxx\Debug\4u62201l\x86\compile_commands.json  2 +{C:\Users\Sage Becker\OneDrive\Desktop\gp\active\archenemy-updated\android\app\.cxx\Debug\4u62201l\x86\compile_commands.json  Õ2  -C:\Users\Sage Becker\OneDrive\Desktop\gp\active\archenemy-updated\android\app\.cxx\Debug\4u62201l\x86\compile_commands.json.bin  2  +C:\Users\Sage Becker\OneDrive\Desktop\gp\active\archenemy-updated\android\app\.cxx\Debug\4u62201l\x86\compile_commands.json.bin  Õ2   -C:\Users\Sage Becker\OneDrive\Desktop\gp\active\archenemy-updated\android\app\.cxx\Debug\4u62201l\x86\metadata_generation_command.txt  2 +C:\Users\Sage Becker\OneDrive\Desktop\gp\active\archenemy-updated\android\app\.cxx\Debug\4u62201l\x86\metadata_generation_command.txt  Õ2  ܯ2| z -xC:\Users\Sage Becker\OneDrive\Desktop\gp\active\archenemy-updated\android\app\.cxx\Debug\4u62201l\x86\prefab_config.json  2  ( ܯ2 +xC:\Users\Sage Becker\OneDrive\Desktop\gp\active\archenemy-updated\android\app\.cxx\Debug\4u62201l\x86\prefab_config.json  Õ2  ( ܯ2  -}C:\Users\Sage Becker\OneDrive\Desktop\gp\active\archenemy-updated\android\app\.cxx\Debug\4u62201l\x86\symbol_folder_index.txt  2  t ܯ2O +}C:\Users\Sage Becker\OneDrive\Desktop\gp\active\archenemy-updated\android\app\.cxx\Debug\4u62201l\x86\symbol_folder_index.txt  Õ2  t ܯ2O M -KC:\dev\flutter\packages\flutter_tools\gradle\src\main\groovy\CMakeLists.txt  2  ͒2 \ No newline at end of file +KC:\dev\flutter\packages\flutter_tools\gradle\src\main\groovy\CMakeLists.txt  Õ2  ͒2 \ No newline at end of file diff --git a/android/app/.cxx/Debug/4u62201l/x86_64/configure_fingerprint.bin b/android/app/.cxx/Debug/4u62201l/x86_64/configure_fingerprint.bin index 3110f57..33adafc 100644 --- a/android/app/.cxx/Debug/4u62201l/x86_64/configure_fingerprint.bin +++ b/android/app/.cxx/Debug/4u62201l/x86_64/configure_fingerprint.bin @@ -2,27 +2,27 @@ C/C++ Structured Log  C:\Users\Sage Becker\OneDrive\Desktop\gp\active\archenemy-updated\android\app\.cxx\Debug\4u62201l\x86_64\additional_project_files.txtC A -?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint  2  Ɓݯ2 +?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint  Õ2  Ɓݯ2  -C:\Users\Sage Becker\OneDrive\Desktop\gp\active\archenemy-updated\android\app\.cxx\Debug\4u62201l\x86_64\android_gradle_build.json  2 ȁݯ2 +C:\Users\Sage Becker\OneDrive\Desktop\gp\active\archenemy-updated\android\app\.cxx\Debug\4u62201l\x86_64\android_gradle_build.json  Õ2 ȁݯ2  -C:\Users\Sage Becker\OneDrive\Desktop\gp\active\archenemy-updated\android\app\.cxx\Debug\4u62201l\x86_64\android_gradle_build_mini.json  2 ʁݯ2x +C:\Users\Sage Becker\OneDrive\Desktop\gp\active\archenemy-updated\android\app\.cxx\Debug\4u62201l\x86_64\android_gradle_build_mini.json  Õ2 ʁݯ2x v -tC:\Users\Sage Becker\OneDrive\Desktop\gp\active\archenemy-updated\android\app\.cxx\Debug\4u62201l\x86_64\build.ninja  2 ݯ2| +tC:\Users\Sage Becker\OneDrive\Desktop\gp\active\archenemy-updated\android\app\.cxx\Debug\4u62201l\x86_64\build.ninja  Õ2 ݯ2| z -xC:\Users\Sage Becker\OneDrive\Desktop\gp\active\archenemy-updated\android\app\.cxx\Debug\4u62201l\x86_64\build.ninja.txt  2 +xC:\Users\Sage Becker\OneDrive\Desktop\gp\active\archenemy-updated\android\app\.cxx\Debug\4u62201l\x86_64\build.ninja.txt  Õ2  -}C:\Users\Sage Becker\OneDrive\Desktop\gp\active\archenemy-updated\android\app\.cxx\Debug\4u62201l\x86_64\build_file_index.txt  2 K ́ݯ2 +}C:\Users\Sage Becker\OneDrive\Desktop\gp\active\archenemy-updated\android\app\.cxx\Debug\4u62201l\x86_64\build_file_index.txt  Õ2 K ́ݯ2  -~C:\Users\Sage Becker\OneDrive\Desktop\gp\active\archenemy-updated\android\app\.cxx\Debug\4u62201l\x86_64\compile_commands.json  2 +~C:\Users\Sage Becker\OneDrive\Desktop\gp\active\archenemy-updated\android\app\.cxx\Debug\4u62201l\x86_64\compile_commands.json  Õ2  -C:\Users\Sage Becker\OneDrive\Desktop\gp\active\archenemy-updated\android\app\.cxx\Debug\4u62201l\x86_64\compile_commands.json.bin  2  +C:\Users\Sage Becker\OneDrive\Desktop\gp\active\archenemy-updated\android\app\.cxx\Debug\4u62201l\x86_64\compile_commands.json.bin  Õ2   -C:\Users\Sage Becker\OneDrive\Desktop\gp\active\archenemy-updated\android\app\.cxx\Debug\4u62201l\x86_64\metadata_generation_command.txt  2 +C:\Users\Sage Becker\OneDrive\Desktop\gp\active\archenemy-updated\android\app\.cxx\Debug\4u62201l\x86_64\metadata_generation_command.txt  Õ2  ˁݯ2 } -{C:\Users\Sage Becker\OneDrive\Desktop\gp\active\archenemy-updated\android\app\.cxx\Debug\4u62201l\x86_64\prefab_config.json  2  ( ́ݯ2 +{C:\Users\Sage Becker\OneDrive\Desktop\gp\active\archenemy-updated\android\app\.cxx\Debug\4u62201l\x86_64\prefab_config.json  Õ2  ( ́ݯ2  -C:\Users\Sage Becker\OneDrive\Desktop\gp\active\archenemy-updated\android\app\.cxx\Debug\4u62201l\x86_64\symbol_folder_index.txt  2  w ́ݯ2O +C:\Users\Sage Becker\OneDrive\Desktop\gp\active\archenemy-updated\android\app\.cxx\Debug\4u62201l\x86_64\symbol_folder_index.txt  Õ2  w ́ݯ2O M -KC:\dev\flutter\packages\flutter_tools\gradle\src\main\groovy\CMakeLists.txt  2  ͒2 \ No newline at end of file +KC:\dev\flutter\packages\flutter_tools\gradle\src\main\groovy\CMakeLists.txt  Õ2  ͒2 \ No newline at end of file diff --git a/lib/main.dart b/lib/main.dart index 88c7b80..c3b7f9c 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -69,9 +69,8 @@ class RootState extends State { if (auth.hasUser) { return App(); } else { - // circumventing login by commenting out the above - // return LoginPage(); - return App(); + return LoginPage(); + //return App(); // use to circumvent login issues } } } diff --git a/lib/pages/explore.dart b/lib/pages/explore.dart index a6aa9b8..953af6b 100644 --- a/lib/pages/explore.dart +++ b/lib/pages/explore.dart @@ -6,7 +6,7 @@ class User { final DateTime birthDate; final String bio; final List interests; - final String assetPath; // URL to a high‑res image + final String assetPath; User({ required this.name, @@ -104,11 +104,11 @@ class _ExplorePageState extends State { Positioned( left: 16, right: 16, - bottom: 100, + bottom: 130, child: Container( padding: const EdgeInsets.all(16), decoration: BoxDecoration( - color: Colors.black.withOpacity(0.4), + color: Colors.black.withValues(alpha: 0.4), borderRadius: BorderRadius.circular(12), ), child: Column( @@ -144,7 +144,8 @@ class _ExplorePageState extends State { fontSize: 14, ), ), - backgroundColor: Colors.black.withOpacity(0.4), + backgroundColor: + Colors.black.withValues(alpha: 0.4), ); }).toList(), ) @@ -172,26 +173,26 @@ class _ExplorePageState extends State { right: 0, child: Row( mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: [ - FloatingActionButton( - heroTag: 'thumbsDown', - elevation: 6, - backgroundColor: Colors.red, - onPressed: () { - _controller.swipe(CardSwiperDirection.left); - }, - child: const Icon(Icons.thumb_down), - ), - FloatingActionButton( - heroTag: 'thumbsUp', - elevation: 6, - backgroundColor: Colors.green, - onPressed: () { - _controller.swipe(CardSwiperDirection.right); - }, - child: const Icon(Icons.thumb_up), - ), - ], + // children: [ + // FloatingActionButton( + // heroTag: 'thumbsDown', + // elevation: 6, + // backgroundColor: Colors.red, + // onPressed: () { + // _controller.swipe(CardSwiperDirection.left); + // }, + // child: const Icon(Icons.thumb_down), + // ), + // FloatingActionButton( + // heroTag: 'thumbsUp', + // elevation: 6, + // backgroundColor: Colors.green, + // onPressed: () { + // _controller.swipe(CardSwiperDirection.right); + // }, + // child: const Icon(Icons.thumb_up), + // ), + // ], ), ), ], @@ -205,108 +206,3 @@ class _ExplorePageState extends State { super.dispose(); } } - -/////////////////////////////////////////////////////////////////////////////// - -// class ExplorePage extends StatefulWidget { -// List profiles; -// ExplorePage(this.profiles, {super.key}); - -// @override -// createState() => _ExplorePageState(); -// } - -// class _ExplorePageState extends State { -// @override -// build(BuildContext context) { -// final profiles = widget.profiles; -// final profileView = profiles.isEmpty -// ? Center(child: Text("No more profiles!")) -// : ProfileView(profiles.last); - -// return Stack(children: [ -// profileView, -// Positioned( -// bottom: 10.0, -// left: 10.0, -// child: IconButton.filled( -// icon: Icon(Icons.close), -// onPressed: () { -// log.d("Disiked!"); -// setState(() { -// widget.profiles.removeLast(); -// }); -// })), -// Positioned( -// bottom: 10.0, -// right: 10.0, -// child: IconButton.filled( -// icon: Icon(Icons.check), -// onPressed: () { -// log.d("Liked!"); -// setState(() { -// widget.profiles.removeLast(); -// }); -// }), -// ) -// ]); -// } -// } - -// import 'package:flutter/material.dart'; -// import '../profile.dart'; -// import '../log.dart' as log; -// import 'package:hatingapp/api.dart' as api; - -// final class ExplorePage extends StatefulWidget { -// const ExplorePage({super.key}); - -// @override -// createState() => _ExplorePageState(); -// } - -// class _ExplorePageState extends State { -// //Future future; - -// @override -// build(BuildContext context) { -// return FutureBuilder( -// future: api.getNextExploreProfile(), -// builder: (context, snapshot) { -// if (snapshot.connectionState != ConnectionState.done) { -// return Center(child: CircularProgressIndicator()); -// } else { -// final profile = snapshot.data; -// final profileView = profile == null -// ? ProfileView(Profile.dummy( -// "")) //Center(child: Text("No more profiles!")) -// : ProfileView(profile); - -// return Stack(children: [ -// profileView, -// Positioned( -// bottom: 10.0, -// left: 10.0, -// child: IconButton.filled( -// icon: Icon(Icons.close), -// onPressed: () async { -// await api.popExploreProfile(liked: false); -// log.debug("Disiked!"); -// setState(() {}); -// })), -// Positioned( -// bottom: 10.0, -// right: 10.0, -// child: IconButton.filled( -// icon: Icon(Icons.check), -// onPressed: () async { -// await api.popExploreProfile(liked: false); -// log.debug("Liked!"); -// setState(() {}); -// }), -// ) -// ]); -// } -// }); -// } -// } diff --git a/lib/pages/matches.dart b/lib/pages/matches.dart index 850afae..111d10a 100644 --- a/lib/pages/matches.dart +++ b/lib/pages/matches.dart @@ -1,7 +1,6 @@ import 'package:flutter/material.dart'; import '../profile.dart'; -// Simple model to distinguish "mine" vs. "theirs" class ChatMessage { final String text; final bool isMine; @@ -198,56 +197,3 @@ class ChatPageState extends State { ); } } - - - - - - -// import 'package:flutter/material.dart'; -// import '../profile.dart'; - - -// /*class Match { -// Profile profile; -// //Profile? profile; // We may not have their profile from the server yet -// }*/ - - -// class MatchesPage extends StatelessWidget { - -// final List profiles = [ -// Profile.dummy("Match 1"), -// Profile.dummy("Match 2"), -// Profile.dummy("Match 3"), -// //Profile("Match 1", DateTime.now(), "Example Bio", ["I1", "I2"]), -// //Profile("Match 2", DateTime.now(), "Example Bio", ["I1", "I2"]), -// //Profile("Match 3", DateTime.now(), "Example Bio", ["I1", "I2"]), -// ]; -// MatchesPage({ super.key }); - -// @override -// Widget build(BuildContext context) { - -// Widget profileEntryBuilder(Profile profile) { -// return ListTile( -// title: Text(profile.displayName), -// subtitle: Text("[latest message...]"), -// leading: SizedBox.fromSize( -// size: Size(40.0, 40.0), -// child: Placeholder() -// ), -// trailing: Icon(Icons.arrow_right) -// ); -// } - -// return ListView.separated( -// itemCount: profiles.length, -// itemBuilder: (context, i) => profileEntryBuilder(profiles[i]), -// separatorBuilder: (context, i) => Divider(color: Colors.blueGrey[700], thickness: 2, indent: 10, endIndent: 10) -// ); -// } -// } - - - diff --git a/lib/pages/myprofile.dart b/lib/pages/myprofile.dart index 5e73c50..ff05fc2 100644 --- a/lib/pages/myprofile.dart +++ b/lib/pages/myprofile.dart @@ -45,7 +45,7 @@ class MyProfilePageState extends State { Widget build(BuildContext context) { final profile = DummyProfile.example(); final cs = Theme.of(context).colorScheme; - final txt = Theme.of(context).textTheme; + // final txt = Theme.of(context).textTheme; return Scaffold( backgroundColor: cs.surface, @@ -57,8 +57,17 @@ class MyProfilePageState extends State { right: 10, child: IconButton( icon: Icon(Icons.menu, color: cs.onSurface), - onPressed: () { - // Handle menu action + onPressed: () async { + await Navigator.push( + context, + MaterialPageRoute( + ////////////////Commented out until api integration////////// + /// builder: (context) => EditProfile(profile), + //////////////////////////////////////////////////////////// + builder: (context) => EditProfile(), // use for now + ), + ); + setState(() {}); }, ), ), @@ -223,226 +232,182 @@ class ProfileViewState extends State { } } -// import 'package:flutter/material.dart'; -// import '../profile.dart'; -// import '../api.dart' as api; - -// class MyProfilePage extends StatefulWidget { -// const MyProfilePage({super.key}); -// @override -// createState() => _MyProfilePageState(); -// } - -// class _MyProfilePageState extends State { -// @override -// build(BuildContext context) { -// return FutureBuilder( -// future: api.getMyProfile(), -// builder: (context, snapshot) { -// final Profile? profile = snapshot.data; -// if (profile == null) { -// return Center(child: CircularProgressIndicator()); -// } else { -// return Stack(children: [ -// ProfileView(profile), -// Positioned( -// top: 60, -// right: 10, -// child: IconButton( -// icon: Icon(Icons.menu), -// onPressed: () async { -// await Navigator.push( -// context, -// MaterialPageRoute( -// builder: (context) => EditProfile(profile))); -// setState(() {}); -// }, -// )) -// ]); -// } -// }); -// } -// } - -// //////////////////////////////////////////////////// -// /// Use: use navigator.push and pass a profile class. -// /// then put : -// /// -// /// .then((_) { -// /// setState(() { -// /// widget.myProfile; -// /// }); -// /// } -// /// immediately after the Navigator.push argument -// /// the profile will be edited in the next page -// /// once the data is saved and pop'd off the widget tree -// /// the profile data will be updated on the current page -// /////////////////////////////////////////////////////// - -// class EditProfile extends StatefulWidget { -// const EditProfile(this.myProfile, {super.key}); -// final Profile myProfile; -// @override -// State createState() => _EditProfileState(); -// } - -// class _EditProfileState extends State { -// DateTime? selectedDate = DateTime.now(); -// String? enteredName = "name"; -// String? enteredBio = "bio"; - -// final TextEditingController nameController = TextEditingController(); -// final TextEditingController bioController = TextEditingController(); -// final GlobalKey nameFormKey = GlobalKey(); -// String? forceErrorText; -// bool isLoading = false; - -// @override -// void dispose() { -// nameController.dispose(); -// bioController.dispose(); -// super.dispose(); -// } - -// String? validator(String? value) { -// if (value == null || value.isEmpty) { -// return 'This field is required'; -// } -// if (int.tryParse(value[0]) != null) { -// return 'Name must not start with a number'; -// } -// return null; -// } - -// String? bioValidator(String? value) { -// if (value == null || value.isEmpty) { -// return 'This field is required'; -// } -// return null; -// } - -// void onChanged(String value) { -// // Nullify forceErrorText if the input changed. -// if (forceErrorText != null) { -// setState(() { -// forceErrorText = null; -// }); -// } -// } - -// Future onSave() async { -// // Providing a default value in case this was called on the -// // first frame, the [fromKey.currentState] will be null. -// final bool isValid = nameFormKey.currentState?.validate() ?? false; -// if (!isValid) { -// return; -// } - -// setState(() => isLoading = true); -// final String? errorText = -// await validateUsernameFromServer(nameController.text); - -// if (context.mounted) { -// setState(() => isLoading = false); -// if (errorText != null) { -// setState(() { -// forceErrorText = errorText; -// }); -// } - -// setState(() { -// // widget.myProfile.update(nameController.text, -// // selectedDate ?? DateTime.now(), bioController.text); -// widget.myProfile.displayName = nameController.text; -// //widget.myProfile.birthDate = selectedDate ?? DateTime.now(); -// widget.myProfile.bio = bioController.text; -// api.patchMyProfile(widget.myProfile); -// //print("Saved"); -// }); -// } -// } - -// Future validateUsernameFromServer(String username) async { -// final Set takenUsernames = {'jack', 'alex'}; - -// await Future.delayed(Duration(seconds: 1)); - -// final bool isValid = !takenUsernames.contains(username); -// if (isValid) { -// return null; -// } - -// return 'Username $username is already taken'; -// } - -// Future _selectDate() async { -// final DateTime? pickedDate = await showDatePicker( -// context: context, -// initialDate: DateTime.now(), -// firstDate: DateTime(1000), -// lastDate: DateTime.now(), -// ); - -// setState(() { -// selectedDate = pickedDate; -// }); -// } - -// @override -// Widget build(BuildContext context) { -// return Scaffold( -// appBar: AppBar( -// backgroundColor: Theme.of(context).colorScheme.inversePrimary, -// title: Text('Edit Profile'), -// ), -// body: Center( -// child: Padding( -// padding: EdgeInsets.all(16.0), -// child: Form( -// key: nameFormKey, -// child: Column( -// mainAxisAlignment: MainAxisAlignment.center, -// children: [ -// TextFormField( -// forceErrorText: forceErrorText, -// controller: nameController, -// validator: validator, -// onChanged: onChanged, -// decoration: const InputDecoration( -// border: UnderlineInputBorder(), -// labelText: 'Enter your name', -// ), -// ), -// TextFormField( -// minLines: 1, -// maxLines: 10, -// maxLength: 1000, -// decoration: const InputDecoration( -// border: UnderlineInputBorder(), -// labelText: 'What really grinds your gears', -// ), -// forceErrorText: forceErrorText, -// controller: bioController, -// validator: bioValidator, -// onChanged: onChanged, -// ), -// Text( -// selectedDate != null -// ? '${selectedDate!.day}/${selectedDate!.month}/${selectedDate!.year}' -// : 'No date selected', -// ), -// TextButton( -// onPressed: _selectDate, -// child: const Text("Birthday")), -// if (isLoading) -// const CircularProgressIndicator() -// else -// TextButton( -// onPressed: onSave, -// child: Text('Save'), -// ) -// ]))), -// ), -// ); -// } -// } +class EditProfile extends StatefulWidget { + ////////////////Commented out until api integration///////////////// + // const EditProfile(this.myProfile, {super.key}); + // final Profile myProfile; + /////////////////////////////////////////////////////////////// + @override + State createState() => _EditProfileState(); +} + +class _EditProfileState extends State { + DateTime? selectedDate = DateTime.now(); + String? enteredName = "name"; + String? enteredBio = "bio"; + + final TextEditingController nameController = TextEditingController(); + final TextEditingController bioController = TextEditingController(); + final GlobalKey nameFormKey = GlobalKey(); + String? forceErrorText; + bool isLoading = false; + + @override + void dispose() { + nameController.dispose(); + bioController.dispose(); + super.dispose(); + } + + String? validator(String? value) { + if (value == null || value.isEmpty) { + return 'This field is required'; + } + if (int.tryParse(value[0]) != null) { + return 'Name must not start with a number'; + } + return null; + } + + String? bioValidator(String? value) { + if (value == null || value.isEmpty) { + return 'This field is required'; + } + return null; + } + + void onChanged(String value) { + // Nullify forceErrorText if the input changed. + if (forceErrorText != null) { + setState(() { + forceErrorText = null; + }); + } + } + + Future onSave() async { + // Providing a default value in case this was called on the + // first frame, the [fromKey.currentState] will be null. + final bool isValid = nameFormKey.currentState?.validate() ?? false; + if (!isValid) { + return; + } + + setState(() => isLoading = true); + final String? errorText = await validateUsernameFromServer( + nameController.text, + ); + + if (context.mounted) { + setState(() => isLoading = false); + if (errorText != null) { + setState(() { + forceErrorText = errorText; + }); + } + + setState(() { + // widget.myProfile.update(nameController.text, + // selectedDate ?? DateTime.now(), bioController.text); + + ////////////////Commented out until api integration////////// + /// widget.myProfile.displayName = nameController.text; + ///////////////////////////////////////////////////////////// + + //widget.myProfile.birthDate = selectedDate ?? DateTime.now(); + + ////////////////Commented out until api integration////////// + /// widget.myProfile.bio = bioController.text; + /// api.patchMyProfile(widget.myProfile); + //////////////////////////////////////////////////////////// + + //print("Saved"); + }); + } + } + + Future validateUsernameFromServer(String username) async { + final Set takenUsernames = {'jack', 'alex'}; + + await Future.delayed(Duration(seconds: 1)); + + final bool isValid = !takenUsernames.contains(username); + if (isValid) { + return null; + } + + return 'Username $username is already taken'; + } + + Future _selectDate() async { + final DateTime? pickedDate = await showDatePicker( + context: context, + initialDate: DateTime.now(), + firstDate: DateTime(1000), + lastDate: DateTime.now(), + ); + + setState(() { + selectedDate = pickedDate; + }); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + backgroundColor: Theme.of(context).colorScheme.inversePrimary, + title: Text('Edit Profile'), + ), + body: Center( + child: Padding( + padding: EdgeInsets.all(16.0), + child: Form( + key: nameFormKey, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + TextFormField( + forceErrorText: forceErrorText, + controller: nameController, + validator: validator, + onChanged: onChanged, + decoration: const InputDecoration( + border: UnderlineInputBorder(), + labelText: 'Enter your name', + ), + ), + TextFormField( + minLines: 1, + maxLines: 10, + maxLength: 1000, + decoration: const InputDecoration( + border: UnderlineInputBorder(), + labelText: 'What really grinds your gears', + ), + forceErrorText: forceErrorText, + controller: bioController, + validator: bioValidator, + onChanged: onChanged, + ), + Text( + selectedDate != null + ? '${selectedDate!.day}/${selectedDate!.month}/${selectedDate!.year}' + : 'No date selected', + ), + TextButton( + onPressed: _selectDate, + child: const Text("Birthday"), + ), + if (isLoading) + const CircularProgressIndicator() + else + TextButton(onPressed: onSave, child: Text('Save')), + ], + ), + ), + ), + ), + ); + } +} diff --git a/lib/pages/settings.dart b/lib/pages/settings.dart index 64be708..2b6605c 100644 --- a/lib/pages/settings.dart +++ b/lib/pages/settings.dart @@ -39,7 +39,7 @@ class _SettingsPageState extends State { // iterate over built‑in ThemeMode values for (var mode in ThemeMode.values) RadioListTile( - title: Text(mode.name.capitalize()), // "system", "light", "dark" + title: Text(mode.name.capitalize()), value: mode, groupValue: _currentMode, onChanged: (chosen) {