diff --git a/gsf/ios/Runner.xcodeproj/project.pbxproj b/gsf/ios/Runner.xcodeproj/project.pbxproj index a187d26..18e4556 100644 --- a/gsf/ios/Runner.xcodeproj/project.pbxproj +++ b/gsf/ios/Runner.xcodeproj/project.pbxproj @@ -171,6 +171,7 @@ 9AD36002AE69EB67FA0E045C /* Frameworks */, ); sourceTree = ""; + usesTabs = 0; }; 97C146EF1CF9000F007C117D /* Products */ = { isa = PBXGroup; diff --git a/gsf/ios/Runner/Info.plist b/gsf/ios/Runner/Info.plist index 4997ef7..c2340b7 100644 --- a/gsf/ios/Runner/Info.plist +++ b/gsf/ios/Runner/Info.plist @@ -23,7 +23,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 1.4.3 + 1.4.4 CFBundleSignature ???? CFBundleURLTypes @@ -55,6 +55,8 @@ Getsetfit use calendar to get current datetime NSCameraUsageDescription To capture profile photo please grant camera access + NSFaceIDUsageDescription + For user authentication NSHealthShareUsageDescription We will sync your data with the Apple Health app to give you better insights NSHealthUpdateUsageDescription @@ -75,8 +77,6 @@ Allow access to photo library NSSpeechRecognitionUsageDescription sprecg - NSFaceIDUsageDescription - For user authentication UIApplicationSupportsIndirectInputEvents UIBackgroundModes diff --git a/gsf/lib/views/components/mood_meter.dart b/gsf/lib/views/components/mood_meter.dart index 1a31916..6cd500a 100644 --- a/gsf/lib/views/components/mood_meter.dart +++ b/gsf/lib/views/components/mood_meter.dart @@ -13,10 +13,9 @@ import '../theme.dart'; int activeIndexMoodOMeter = -1; - class MoodOMeter extends StatefulWidget { - const MoodOMeter({Key? key}) : super(key: key); - + MoodOMeter({Key? key, this.fromHomePage}) : super(key: key); + bool? fromHomePage; @override State createState() => _MoodOMeterState(); } @@ -39,31 +38,29 @@ class _MoodOMeterState extends State { children: [ GestureDetector( onTap: () { - setState(() => isLoading = !isLoading); - MoodOMeterService() - .uploadMood("Very Happy") - .then((value) async { - var jsonResp = jsonDecode(value.body); - homeApiController.setMoodOMeterResp(jsonResp); - // SetMoodResponse setMoodResponse = SetMoodResponse(); - // setMoodResponse = SetMoodResponse.fromJson(jsonResp); - // print("setMoodResponse $setMoodResponse"); - // // SetMoodRespon; - // // setMoodResponse.success; - // print( "setMoodResponse ${setMoodResponse.success}"); - // print("pro ${setMoodResponse.progressBar}"); + if (widget.fromHomePage ?? false) { + setState(() { + activeIndexMoodOMeter = 0; + }); + } else { + setState(() => isLoading = !isLoading); + MoodOMeterService() + .uploadMood("Very Happy") + .then((value) async { + var jsonResp = jsonDecode(value.body); + homeApiController.setMoodOMeterResp(jsonResp); - // print("uploadMood $value"); - var moodResult = await MoodOMeterService().getMoodOMeter(); - // if() - if(moodResult.responseStatus == ResponseStatus.success ){ - setState(() { - activeIndexMoodOMeter = 0; - isLoading = !isLoading; - }); - } + var moodResult = + await MoodOMeterService().getMoodOMeter(); + // if() + if (moodResult.responseStatus == ResponseStatus.success) { + setState(() { + activeIndexMoodOMeter = 0; + isLoading = !isLoading; + }); } - ); + }); + } }, child: SvgPicture.asset( activeIndexMoodOMeter == 0 @@ -75,26 +72,26 @@ class _MoodOMeterState extends State { ), GestureDetector( onTap: () { - setState(() => isLoading = !isLoading); - MoodOMeterService() - .uploadMood("Happy") - .then((value) async { - var jsonResp = jsonDecode(value.body); - homeApiController.setMoodOMeterResp(jsonResp); - var moodResult = await MoodOMeterService().getMoodOMeter(); - // if() - if(moodResult.responseStatus == ResponseStatus.success ){ - setState(() { - activeIndexMoodOMeter = 1; - isLoading = !isLoading; - }); - } + if (widget.fromHomePage ?? false) { + setState(() { + activeIndexMoodOMeter = 1; + + }); + } else { + MoodOMeterService().uploadMood("Happy").then((value) async { + var jsonResp = jsonDecode(value.body); + homeApiController.setMoodOMeterResp(jsonResp); + var moodResult = + await MoodOMeterService().getMoodOMeter(); + // if() + if (moodResult.responseStatus == ResponseStatus.success) { + setState(() { + activeIndexMoodOMeter = 1; + isLoading = !isLoading; + }); } - // => setState(() { - // activeIndexMoodOMeter = 1; - // isLoading = !isLoading; - // }) - ); + }); + } }, child: SvgPicture.asset( activeIndexMoodOMeter == 1 @@ -106,26 +103,27 @@ class _MoodOMeterState extends State { ), GestureDetector( onTap: () { - setState(() => isLoading = !isLoading); - MoodOMeterService() - .uploadMood("Ok") - .then((value) async { - var jsonResp = jsonDecode(value.body); - homeApiController.setMoodOMeterResp(jsonResp); - var moodResult = await MoodOMeterService().getMoodOMeter(); - // if() - if(moodResult.responseStatus == ResponseStatus.success ){ - setState(() { - activeIndexMoodOMeter = 2; - isLoading = !isLoading; - }); - } + if (widget.fromHomePage ?? false) { + setState(() { + activeIndexMoodOMeter = 2; + + }); + } else { + setState(() => isLoading = !isLoading); + MoodOMeterService().uploadMood("Ok").then((value) async { + var jsonResp = jsonDecode(value.body); + homeApiController.setMoodOMeterResp(jsonResp); + var moodResult = + await MoodOMeterService().getMoodOMeter(); + // if() + if (moodResult.responseStatus == ResponseStatus.success) { + setState(() { + activeIndexMoodOMeter = 2; + isLoading = !isLoading; + }); } - // => setState(() { - // activeIndexMoodOMeter = 2; - // isLoading = !isLoading; - // }) - ); + }); + } }, child: SvgPicture.asset( activeIndexMoodOMeter == 2 @@ -139,27 +137,29 @@ class _MoodOMeterState extends State { borderRadius: BorderRadius.circular(100), child: GestureDetector( onTap: () { - setState(() => isLoading = !isLoading); - MoodOMeterService().uploadMood("Whatever").then( - (value) async { + if (widget.fromHomePage ?? false) { + setState(() { + activeIndexMoodOMeter = 3; + }); + } else { + setState(() => isLoading = !isLoading); + MoodOMeterService() + .uploadMood("Whatever") + .then((value) async { var jsonResp = jsonDecode(value.body); homeApiController.setMoodOMeterResp(jsonResp); - var moodResult = await MoodOMeterService().getMoodOMeter(); + var moodResult = + await MoodOMeterService().getMoodOMeter(); // if() - if(moodResult.responseStatus == ResponseStatus.success ){ + if (moodResult.responseStatus == + ResponseStatus.success) { setState(() { activeIndexMoodOMeter = 3; isLoading = !isLoading; }); } - } - // => setState( - // () { - // activeIndexMoodOMeter = 3; - // isLoading = !isLoading; - // }, - // ), - ); + }); + } }, child: SvgPicture.asset( activeIndexMoodOMeter == 3 @@ -172,26 +172,31 @@ class _MoodOMeterState extends State { ), GestureDetector( onTap: () { - setState(() => isLoading = !isLoading); - MoodOMeterService() - .uploadMood("Sad") - .then((value) async { - var jsonResp = jsonDecode(value.body); - homeApiController.setMoodOMeterResp(jsonResp); - var moodResult = await MoodOMeterService().getMoodOMeter(); - // if() - if(moodResult.responseStatus == ResponseStatus.success ){ - setState(() { - activeIndexMoodOMeter = 4; - isLoading = !isLoading; - }); - } + if (widget.fromHomePage ?? false) { + setState(() { + activeIndexMoodOMeter = 4; + }); + } else { + setState(() => isLoading = !isLoading); + MoodOMeterService().uploadMood("Sad").then((value) async { + var jsonResp = jsonDecode(value.body); + homeApiController.setMoodOMeterResp(jsonResp); + var moodResult = + await MoodOMeterService().getMoodOMeter(); + // if() + if (moodResult.responseStatus == ResponseStatus.success) { + setState(() { + activeIndexMoodOMeter = 4; + isLoading = !isLoading; + }); } - // => setState(() { - // activeIndexMoodOMeter = 4; - // isLoading = !isLoading; - // }) + } + // => setState(() { + // activeIndexMoodOMeter = 4; + // isLoading = !isLoading; + // }) ); + } }, child: SvgPicture.asset( activeIndexMoodOMeter == 4 diff --git a/gsf/lib/views/pages/MenstrualCycleTracker/FirstQuestion.dart b/gsf/lib/views/pages/MenstrualCycleTracker/FirstQuestion.dart index b26661b..0103c0c 100644 --- a/gsf/lib/views/pages/MenstrualCycleTracker/FirstQuestion.dart +++ b/gsf/lib/views/pages/MenstrualCycleTracker/FirstQuestion.dart @@ -51,151 +51,157 @@ class _FirstQuestionState extends State { body: SingleChildScrollView( child: Padding( padding: const EdgeInsets.all(16), - child: Container( - width: double.infinity, - decoration: const BoxDecoration( - color: Color(0xFF383838), // Set the background color - borderRadius: BorderRadius.only( - topLeft: Radius.circular(12.0), - topRight: Radius.circular(12.0), + child: GestureDetector( + onTap: () { + FocusManager.instance.primaryFocus?.unfocus(); + }, + child: Container( + width: double.infinity, + decoration: const BoxDecoration( + color: Color(0xFF383838), // Set the background color + borderRadius: BorderRadius.only( + topLeft: Radius.circular(12.0), + topRight: Radius.circular(12.0), + ), ), - ), - child: Column( - children: [ - const SizedBox( - height: 64, - ), - Image.asset( - 'assets/image/cycle_time.png', - height: 64, - width: 64, - ), - const SizedBox( - height: 31, - ), - const Text( - "How long do your periods usually last?", - style: TextStyle(fontSize: 18), - ), - const SizedBox( - height: 20, - ), - Container( - width: 147, - height: 43, - decoration: ShapeDecoration( - color: const Color(0xFFBBF046), - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(25.50), - ), + child: Column( + children: [ + const SizedBox( + height: 64, ), - child: Center( - child: showTextField - ? GestureDetector( - onTap: () { - setState(() { - showTextField = !showTextField; - }); - }, - child: const Text( - 'Period Length', - style: TextStyle( - fontSize: 14, // Adjust the font size as needed - color: Colors.black, - ), - )) - : TextFormField( - //textAlign: TextAlign.center, - autofocus: true, - maxLength: 3, - keyboardType: TextInputType.number, - controller: periodLength, - decoration: const InputDecoration( - border: InputBorder.none, - counterText: '', // Hide the character counter - contentPadding: - EdgeInsets.only(left: 60, right: 10), - ), - style: const TextStyle( - // Adjust the text style as needed - color: Colors.black, - ), - onChanged: (value) { - if (value.isEmpty) { + Image.asset( + 'assets/image/cycle_time.png', + height: 64, + width: 64, + ), + const SizedBox( + height: 31, + ), + const Text( + "How long do your periods usually last?", + style: TextStyle(fontSize: 18), + ), + const SizedBox( + height: 20, + ), + Container( + width: 147, + height: 43, + decoration: ShapeDecoration( + color: const Color(0xFFBBF046), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(25.50), + ), + ), + child: Center( + child: showTextField + ? GestureDetector( + onTap: () { setState(() { showTextField = !showTextField; }); - } - }, - ), - ), - ), - const SizedBox( - height: 5, - ), - const Text( - "Days", - style: TextStyle(fontSize: 16), - ), - const SizedBox( - height: 10, - ), - const Text( - "From the first day of bleeding to the last.", - style: TextStyle(fontSize: 18), - ), - const SizedBox( - height: 100, - ), - Padding( - padding: const EdgeInsets.symmetric(horizontal: 15), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - GestureDetector( - onTap: () { - Get.back(); - }, - child: Container( - width: 147, - height: 39, - decoration: ShapeDecoration( - color: const Color(0xFFBBF046), - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(25.50), + }, + child: const Text( + 'Period Length', + style: TextStyle( + fontSize: + 14, // Adjust the font size as needed + color: Colors.black, + ), + )) + : TextFormField( + //textAlign: TextAlign.center, + autofocus: true, + maxLength: 3, + keyboardType: TextInputType.number, + controller: periodLength, + decoration: const InputDecoration( + border: InputBorder.none, + counterText: '', // Hide the character counter + contentPadding: + EdgeInsets.only(left: 60, right: 10), + ), + style: const TextStyle( + // Adjust the text style as needed + color: Colors.black, + ), + onChanged: (value) { + if (value.isEmpty) { + setState(() { + showTextField = !showTextField; + }); + } + }, ), - ), - child: const Center( - child: Text( - "Back", - style: TextStyle(color: Colors.black), - )), - ), - ), - GestureDetector( - onTap: () { - _validateAnswer(); - }, - child: Container( - width: 147, - height: 39, - decoration: ShapeDecoration( - shape: RoundedRectangleBorder( - side: const BorderSide( - width: 1, color: Colors.white), - borderRadius: BorderRadius.circular(25.50), - ), - ), - child: const Center(child: Text("Next")), - ), - ) - ], + ), ), - ), - SizedBox( - height: 20, - ) - ], + const SizedBox( + height: 5, + ), + const Text( + "Days", + style: TextStyle(fontSize: 16), + ), + const SizedBox( + height: 10, + ), + const Text( + "From the first day of bleeding to the last.", + style: TextStyle(fontSize: 18), + ), + const SizedBox( + height: 100, + ), + Padding( + padding: const EdgeInsets.symmetric(horizontal: 15), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + GestureDetector( + onTap: () { + Get.back(); + }, + child: Container( + width: 147, + height: 39, + decoration: ShapeDecoration( + color: const Color(0xFFBBF046), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(25.50), + ), + ), + child: const Center( + child: Text( + "Back", + style: TextStyle(color: Colors.black), + )), + ), + ), + GestureDetector( + onTap: () { + _validateAnswer(); + }, + child: Container( + width: 147, + height: 39, + decoration: ShapeDecoration( + shape: RoundedRectangleBorder( + side: const BorderSide( + width: 1, color: Colors.white), + borderRadius: BorderRadius.circular(25.50), + ), + ), + child: const Center(child: Text("Next")), + ), + ) + ], + ), + ), + SizedBox( + height: 20, + ) + ], + ), ), ), ), diff --git a/gsf/lib/views/pages/MenstrualCycleTracker/SecondQuestion.dart b/gsf/lib/views/pages/MenstrualCycleTracker/SecondQuestion.dart index 9de9755..dc06811 100644 --- a/gsf/lib/views/pages/MenstrualCycleTracker/SecondQuestion.dart +++ b/gsf/lib/views/pages/MenstrualCycleTracker/SecondQuestion.dart @@ -50,154 +50,160 @@ class _SecondQuestionState extends State { body: SingleChildScrollView( child: Padding( padding: const EdgeInsets.all(16), - child: Container( - width: double.infinity, - decoration: const BoxDecoration( - color: Color(0xFF383838), // Set the background color - borderRadius: BorderRadius.only( - topLeft: Radius.circular(12.0), - topRight: Radius.circular(12.0), + child: GestureDetector( + onTap: () { + FocusManager.instance.primaryFocus?.unfocus(); + }, + child: Container( + width: double.infinity, + decoration: const BoxDecoration( + color: Color(0xFF383838), // Set the background color + borderRadius: BorderRadius.only( + topLeft: Radius.circular(12.0), + topRight: Radius.circular(12.0), + ), ), - ), - child: Column( - children: [ - const SizedBox( - height: 64, - ), - Image.asset( - 'assets/image/cycle_time.png', - height: 64, - width: 64, - ), - const SizedBox( - height: 31, - ), - const Text( - "How long do your Cycle usually last?", - style: TextStyle(fontSize: 18), - ), - const SizedBox( - height: 20, - ), - Container( - width: 147, - height: 43, - decoration: ShapeDecoration( - color: const Color(0xFFBBF046), - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(25.50), - ), + child: Column( + children: [ + const SizedBox( + height: 64, ), - child: Center( - child: showTextField - ? GestureDetector( - onTap: () { - setState(() { - showTextField = !showTextField; - }); - }, - child: const Text( - 'Period Length', - style: TextStyle( - fontSize: 14, // Adjust the font size as needed - color: Colors.black, - ), - )) - : TextFormField( - //textAlign: TextAlign.center, - autofocus: true, - maxLength: 3, - keyboardType: TextInputType.number, - controller: periodCycleLength, - decoration: const InputDecoration( - border: InputBorder.none, - counterText: '', // Hide the character counter - contentPadding: - EdgeInsets.only(left: 60, right: 10), - ), - style: const TextStyle( - // Adjust the text style as needed - color: Colors.black, - ), - onChanged: (value) { - if (value.isEmpty) { + Image.asset( + 'assets/image/cycle_time.png', + height: 64, + width: 64, + ), + const SizedBox( + height: 31, + ), + const Text( + "How long do your Cycle usually last?", + style: TextStyle(fontSize: 18), + ), + const SizedBox( + height: 20, + ), + Container( + width: 147, + height: 43, + decoration: ShapeDecoration( + color: const Color(0xFFBBF046), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(25.50), + ), + ), + child: Center( + child: showTextField + ? GestureDetector( + onTap: () { setState(() { showTextField = !showTextField; }); - } - }, - ), - ), - ), - const SizedBox( - height: 5, - ), - const Text( - "Days", - style: TextStyle(fontSize: 16), - ), - const SizedBox( - height: 10, - ), - const Padding( - padding: EdgeInsets.symmetric(horizontal: 14), - child: Text( - "From the day one period starts until the next one starts.", - style: TextStyle(fontSize: 18), - ), - ), - const SizedBox( - height: 100, - ), - Padding( - padding: const EdgeInsets.symmetric(horizontal: 15), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - GestureDetector( - onTap: () { - Get.back(); - }, - child: Container( - width: 147, - height: 39, - decoration: ShapeDecoration( - color: const Color(0xFFBBF046), - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(25.50), + }, + child: const Text( + 'Period Length', + style: TextStyle( + fontSize: + 14, // Adjust the font size as needed + color: Colors.black, + ), + )) + : TextFormField( + //textAlign: TextAlign.center, + autofocus: true, + maxLength: 3, + keyboardType: TextInputType.number, + controller: periodCycleLength, + decoration: const InputDecoration( + border: InputBorder.none, + counterText: '', // Hide the character counter + contentPadding: + EdgeInsets.only(left: 60, right: 10), + ), + style: const TextStyle( + // Adjust the text style as needed + color: Colors.black, + ), + onChanged: (value) { + if (value.isEmpty) { + setState(() { + showTextField = !showTextField; + }); + } + }, ), - ), - child: const Center( - child: Text( - "Back", - style: TextStyle(color: Colors.black), - )), - ), - ), - GestureDetector( - onTap: () { - _validateAnswer(); - }, - child: Container( - width: 147, - height: 39, - decoration: ShapeDecoration( - shape: RoundedRectangleBorder( - side: const BorderSide( - width: 1, color: Colors.white), - borderRadius: BorderRadius.circular(25.50), - ), - ), - child: const Center(child: Text("Next")), - ), - ) - ], + ), ), - ), - const SizedBox( - height: 20, - ) - ], + const SizedBox( + height: 5, + ), + const Text( + "Days", + style: TextStyle(fontSize: 16), + ), + const SizedBox( + height: 10, + ), + const Padding( + padding: EdgeInsets.symmetric(horizontal: 14), + child: Text( + "From the day one period starts until the next one starts.", + style: TextStyle(fontSize: 18), + ), + ), + const SizedBox( + height: 100, + ), + Padding( + padding: const EdgeInsets.symmetric(horizontal: 15), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + GestureDetector( + onTap: () { + Get.back(); + }, + child: Container( + width: 147, + height: 39, + decoration: ShapeDecoration( + color: const Color(0xFFBBF046), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(25.50), + ), + ), + child: const Center( + child: Text( + "Back", + style: TextStyle(color: Colors.black), + )), + ), + ), + GestureDetector( + onTap: () { + _validateAnswer(); + }, + child: Container( + width: 147, + height: 39, + decoration: ShapeDecoration( + shape: RoundedRectangleBorder( + side: const BorderSide( + width: 1, color: Colors.white), + borderRadius: BorderRadius.circular(25.50), + ), + ), + child: const Center(child: Text("Next")), + ), + ) + ], + ), + ), + const SizedBox( + height: 20, + ) + ], + ), ), ), ), diff --git a/gsf/lib/views/pages/MenstrualCycleTracker/TrackerHomePage.dart b/gsf/lib/views/pages/MenstrualCycleTracker/TrackerHomePage.dart index b36f2f9..87852a9 100644 --- a/gsf/lib/views/pages/MenstrualCycleTracker/TrackerHomePage.dart +++ b/gsf/lib/views/pages/MenstrualCycleTracker/TrackerHomePage.dart @@ -28,6 +28,9 @@ class _TrackerHomePageState extends State { void initState() { isFilled = StorageService().readinitialSetup(); if (isFilled!) { + Future.delayed(const Duration(seconds: 1), () { + helperController.isLoading.value = false; + }); } else { callCalculations(); } @@ -61,6 +64,9 @@ class _TrackerHomePageState extends State { await helperController.calculateFirstTime(); await helperController.calculatePeriodDateForCalender(); await helperController.calculateOutOfDays(); + Future.delayed(const Duration(seconds: 1), () { + setState(() {}); + }); } @override diff --git a/gsf/lib/views/pages/MenstrualCycleTracker/viewModel/DeleteDatesOnLogout.dart b/gsf/lib/views/pages/MenstrualCycleTracker/viewModel/DeleteDatesOnLogout.dart new file mode 100644 index 0000000..220b3ee --- /dev/null +++ b/gsf/lib/views/pages/MenstrualCycleTracker/viewModel/DeleteDatesOnLogout.dart @@ -0,0 +1,15 @@ +import '../../../../api/base_manager.dart'; +import '../../../../api/network_api.dart'; + +class DeleteDatesOnLogout { + Future> deleteDates(updata) async { + final response = await NetworkApi() + .postApi(url: "https://thegsf.co/api/deletePeriodDates", data: updata); + if (response.status == ResponseStatus.SUCCESS) { + print("success $response"); + } + print("failed $response"); + + return response; + } +} diff --git a/gsf/lib/views/pages/MenstrualCycleTracker/viewModel/StoringDates.dart b/gsf/lib/views/pages/MenstrualCycleTracker/viewModel/StoringDates.dart index ea01673..067f0a8 100644 --- a/gsf/lib/views/pages/MenstrualCycleTracker/viewModel/StoringDates.dart +++ b/gsf/lib/views/pages/MenstrualCycleTracker/viewModel/StoringDates.dart @@ -13,7 +13,6 @@ import '../../../../api/base_manager.dart'; QuizeModel? quizData; RxList pickerdateRange = [].obs; - final HelperMethods helperController = Get.put(HelperMethods()); class StoringDates { diff --git a/gsf/lib/views/pages/home/home.dart b/gsf/lib/views/pages/home/home.dart index 7275767..750cd22 100644 --- a/gsf/lib/views/pages/home/home.dart +++ b/gsf/lib/views/pages/home/home.dart @@ -703,18 +703,15 @@ class _HomeState extends State with SingleTickerProviderStateMixin { barrierDismissible: false, barrierColor: ColorConstants.kBlack.withOpacity(0.9), builder: (BuildContext context) { - // print('mission impossible'); return Padding( padding: EdgeInsets.symmetric(horizontal: context.width * 0.05), child: FutureBuilder( future: GetOurThoughts().getShareThoughtsData(), builder: (context, snapshot) { - // print("Get thouths dtata news ${snapshot.data!.data}"); if (snapshot.connectionState == ConnectionState.done && snapshot.hasData) { ShareOurthoutghs shareThoughts = snapshot.data!.data; final yourThoutghs = shareThoughts.userThoughts.split('-'); - // print('yourThoutghs ${yourThoutghs}'); return Column( mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, @@ -826,22 +823,22 @@ class _HomeState extends State with SingleTickerProviderStateMixin { ); } - calculateMood(int index) { + calculateMood(int index) async { switch (index) { case 0: - MoodOMeterService().uploadMood("Very Happy"); + await MoodOMeterService().uploadMood("Very Happy"); break; case 1: - MoodOMeterService().uploadMood("Happy"); + await MoodOMeterService().uploadMood("Happy"); break; case 2: - MoodOMeterService().uploadMood("Ok"); + await MoodOMeterService().uploadMood("Ok"); break; case 3: - MoodOMeterService().uploadMood("Whatever"); + await MoodOMeterService().uploadMood("Whatever"); break; case 4: - MoodOMeterService().uploadMood("Sad"); + await MoodOMeterService().uploadMood("Sad"); break; default: Get.snackbar( @@ -943,11 +940,13 @@ class _HomeState extends State with SingleTickerProviderStateMixin { ), ), const SizedBox(height: 34), - const MoodOMeter(), + MoodOMeter( + fromHomePage: true, + ), const SizedBox(height: 34), FullWdtBtn( btnText: 'Share your thoughts!', - onTap: () { + onTap: () async { if (activeIndexMoodOMeter == -1) { Get.snackbar( 'Error', @@ -957,7 +956,7 @@ class _HomeState extends State with SingleTickerProviderStateMixin { colorText: Colors.white, ); } else { - calculateMood(activeIndexMoodOMeter); + await calculateMood(activeIndexMoodOMeter); box.write('showMoodOmeter', false); Get.back(); missionPossible(context); diff --git a/gsf/lib/views/pages/profile/pages/company_profile.dart b/gsf/lib/views/pages/profile/pages/company_profile.dart index 1b2ca27..40be3d7 100644 --- a/gsf/lib/views/pages/profile/pages/company_profile.dart +++ b/gsf/lib/views/pages/profile/pages/company_profile.dart @@ -196,7 +196,7 @@ class _CompanyProfileState extends State { ), ), const SizedBox(height: 16), - const Padding( + Padding( padding: EdgeInsets.symmetric(horizontal: 22.0), child: MoodOMeter(), ), diff --git a/gsf/lib/views/pages/profile/pages/user_dashboard.dart b/gsf/lib/views/pages/profile/pages/user_dashboard.dart index 348620c..61f128e 100644 --- a/gsf/lib/views/pages/profile/pages/user_dashboard.dart +++ b/gsf/lib/views/pages/profile/pages/user_dashboard.dart @@ -453,7 +453,7 @@ class _UserDashboardState extends State { ), ), const SizedBox(height: 8), - const Padding( + Padding( padding: EdgeInsets.symmetric(horizontal: 22), child: MoodOMeter(), ), diff --git a/gsf/lib/views/pages/shareThoutgh/share_thought.dart b/gsf/lib/views/pages/shareThoutgh/share_thought.dart index ce56e25..487e093 100644 --- a/gsf/lib/views/pages/shareThoutgh/share_thought.dart +++ b/gsf/lib/views/pages/shareThoutgh/share_thought.dart @@ -98,7 +98,7 @@ class _ShareThoughtState extends State { ), ), const SizedBox(height: 20), - const MoodOMeter(), + MoodOMeter(), const SizedBox(height: 35), FullWdtBtn( btnText: 'Share your thoughts!', diff --git a/gsf/lib/views/pages/sidebar.dart b/gsf/lib/views/pages/sidebar.dart index 13dd4f3..5b55a6f 100644 --- a/gsf/lib/views/pages/sidebar.dart +++ b/gsf/lib/views/pages/sidebar.dart @@ -1,8 +1,8 @@ - import 'package:firebase_analytics/firebase_analytics.dart'; import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:get/get.dart'; +import 'package:get_storage/get_storage.dart'; import 'package:gsp_app/view_model/QuizApis.dart'; import 'package:gsp_app/view_model/app_data_controller.dart'; import 'package:gsp_app/view_model/common_functions.dart'; @@ -14,12 +14,16 @@ import 'package:gsp_app/views/pages/profile/pages/profile_page.dart'; import 'package:gsp_app/views/pages/signIn/complete_profile_before_sign_in.dart'; import 'package:gsp_app/views/pages/signIn/sign_in.dart'; import 'package:gsp_app/views/pages/subscription/my_subscription.dart'; +import 'package:shared_preferences/shared_preferences.dart'; import 'package:url_launcher/url_launcher.dart'; import '../../view_model/global_controller.dart'; import '../../view_model/home_controller.dart'; import '../../repository/services/complete_profile_service.dart'; import '../../repository/services/edit_profile_service.dart'; import '../theme.dart'; +import 'MenstrualCycleTracker/Helper/HelperMethods.dart'; +import 'MenstrualCycleTracker/viewModel/DeleteDatesOnLogout.dart'; +import 'MenstrualCycleTracker/viewModel/StoringDates.dart'; import 'blog/blog_main.dart'; import 'faq/about_gsf_accordian.dart'; @@ -516,9 +520,23 @@ class _AppDrawerState extends State { borderRadius: BorderRadius.circular(30), ), child: InkWell( - onTap: () { + onTap: () async { // box.write('isLoggedIn', false); // Get.offAll(() => const SignIn()); + + SharedPreferences preferences = + await SharedPreferences.getInstance(); + await preferences.clear(); + await DeleteDatesOnLogout().deleteDates(""); + GetStorage().erase(); + // Get.delete(); + // Get.find().onClose(); + // helperController.dispose(); + + pickerdateRange.clear(); + helperController.predictedDate.clear(); + helperController.ovulatingDate.clear(); + box.write('isLoggedIn', false).then((value) { Get.back(); Get.back();