From 635429092cb7df7255830c787a2db97c0f110f3b Mon Sep 17 00:00:00 2001 From: kishan06 Date: Sun, 5 May 2024 10:45:54 +0530 Subject: [PATCH] latest live code on stores --- .idea/vcs.xml | 1 + .vscode/settings.json | 5 +- gsf/android/app/build.gradle | 2 +- gsf/assets/image/sidebarIcons/delete.svg | 6 + gsf/ios/Runner/Info.plist | 2 +- gsf/lib/repository/endpoints.dart | 1 + .../services/cj/moodOmeter_services.dart | 6 +- .../repository/services/feedbackServices.dart | 8 +- .../services/rateUs/rate_usServices.dart | 4 +- .../services/subscriptionDataService.dart | 7 +- .../viewModel/DeleteDatesOnLogout.dart | 11 ++ gsf/lib/views/pages/feedback/feedback.dart | 20 +-- gsf/lib/views/pages/home/home.dart | 2 +- .../views/pages/settings/setting_main.dart | 4 +- gsf/lib/views/pages/sidebar.dart | 149 ++++++++++++++++++ 15 files changed, 199 insertions(+), 29 deletions(-) create mode 100644 gsf/assets/image/sidebarIcons/delete.svg diff --git a/.idea/vcs.xml b/.idea/vcs.xml index a81ff8d..91267d1 100644 --- a/.idea/vcs.xml +++ b/.idea/vcs.xml @@ -1,6 +1,7 @@ + \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json index 38cbd47..a249c75 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,3 +1,6 @@ { - "dart.flutterSdkPath": "C:\\Flutter_SDK\\flutter" + "dart.flutterSdkPath": "C:\\Flutter_SDK\\flutter", + "Codegeex.Chat.LanguagePreference": "English", + "Codegeex.Comment.LanguagePreference": "English", + "Codegeex.SidebarUI.LanguagePreference": "English" } \ No newline at end of file diff --git a/gsf/android/app/build.gradle b/gsf/android/app/build.gradle index 4680343..d53b4b8 100644 --- a/gsf/android/app/build.gradle +++ b/gsf/android/app/build.gradle @@ -62,7 +62,7 @@ android { // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration. minSdkVersion 26 targetSdkVersion 33 - versionCode 14//flutterVersionCode.toInteger()//3 + versionCode 17//flutterVersionCode.toInteger()//3 versionName "1.0"//flutterVersionName //"1.0" manifestPlaceholders['foregroundServiceType'] = 'health' diff --git a/gsf/assets/image/sidebarIcons/delete.svg b/gsf/assets/image/sidebarIcons/delete.svg new file mode 100644 index 0000000..dfbdba1 --- /dev/null +++ b/gsf/assets/image/sidebarIcons/delete.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/gsf/ios/Runner/Info.plist b/gsf/ios/Runner/Info.plist index c2340b7..8b0bba7 100644 --- a/gsf/ios/Runner/Info.plist +++ b/gsf/ios/Runner/Info.plist @@ -23,7 +23,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 1.4.4 + 1.5.2 CFBundleSignature ???? CFBundleURLTypes diff --git a/gsf/lib/repository/endpoints.dart b/gsf/lib/repository/endpoints.dart index 2bb3cd8..94a4bc8 100644 --- a/gsf/lib/repository/endpoints.dart +++ b/gsf/lib/repository/endpoints.dart @@ -1,6 +1,7 @@ //chaitanya class Endpoints { static const _staging = "https://gsf.betadelivery.com/api/"; + static const _base = "https://thegsf.co/api/"; static const login = _base + "login"; diff --git a/gsf/lib/repository/services/cj/moodOmeter_services.dart b/gsf/lib/repository/services/cj/moodOmeter_services.dart index d4ea249..8c0695f 100644 --- a/gsf/lib/repository/services/cj/moodOmeter_services.dart +++ b/gsf/lib/repository/services/cj/moodOmeter_services.dart @@ -9,7 +9,8 @@ class MoodOMeterService extends GetConnect { HomeApiController homeApiController = Get.put(HomeApiController()); Future getMoodOMeter() async { - + var _token = GetStorage().read("token"); + print("token $_token "); Response response = await get( Endpoints.moodOmeterGet, headers: { @@ -29,8 +30,7 @@ class MoodOMeterService extends GetConnect { // print('moodOmeterResult new $moodOmeterResult'); homeApiController.setMoodOMeterResult(moodOmeterResult); - // print("moodOmeterResult data $moodOmeterResult"); - + // print("moodOmeterResult data $moodOmeterResult"); if (moodOmeterResult != null) { return ResponseModel( diff --git a/gsf/lib/repository/services/feedbackServices.dart b/gsf/lib/repository/services/feedbackServices.dart index b3fa4b3..a7979cc 100644 --- a/gsf/lib/repository/services/feedbackServices.dart +++ b/gsf/lib/repository/services/feedbackServices.dart @@ -7,8 +7,8 @@ GetFeedbackModel? getFeedback; class FeedbackServices { Future> feedbackApi(var data) async { // SharedPreferences prefs = await SharedPreferences.getInstance(); - final response = await NetworkApi().postApi( - url: 'https://gsf.betadelivery.com/api/updateFeedback', data: data); + final response = await NetworkApi() + .postApi(url: 'https://thegsf.co/api/updateFeedback', data: data); if (response.data['success'] == true) { return ResponseData( @@ -20,8 +20,8 @@ class FeedbackServices { } Future> getFeedbackApi() async { - final response = await NetworkApi() - .getApi('https://gsf.betadelivery.com/api/getFeedback'); + final response = + await NetworkApi().getApi('https://thegsf.co/api/getFeedback'); if (response.data['success'] == true) { getFeedback = GetFeedbackModel.fromJson(response.data); diff --git a/gsf/lib/repository/services/rateUs/rate_usServices.dart b/gsf/lib/repository/services/rateUs/rate_usServices.dart index 353a370..35ea973 100644 --- a/gsf/lib/repository/services/rateUs/rate_usServices.dart +++ b/gsf/lib/repository/services/rateUs/rate_usServices.dart @@ -3,8 +3,8 @@ import '../../../api/network_api.dart'; class RateUsServices { Future> postRateUs(updata) async { - final response = await NetworkApi().postApi( - url: 'https://gsf.betadelivery.com/api/updateRateUs', data: updata); + final response = await NetworkApi() + .postApi(url: 'https://thegsf.co/api/updateRateUs', data: updata); if (response.data['success'] == true) { return ResponseData( diff --git a/gsf/lib/repository/services/subscriptionDataService.dart b/gsf/lib/repository/services/subscriptionDataService.dart index f3ebcb9..a6a03ad 100644 --- a/gsf/lib/repository/services/subscriptionDataService.dart +++ b/gsf/lib/repository/services/subscriptionDataService.dart @@ -1,4 +1,3 @@ - import '../../api/ResponseManager.dart'; import '../../api/network_api.dart'; import '../../modals/subscriptionDataModel.dart'; @@ -7,10 +6,10 @@ SubscriptionDataModel? subscriptionObj; class SubscriptionDataService { Future> fetchSubscriptionData() async { - final response = await NetworkApi() - .getApi('https://gsf.betadelivery.com/api/userSubscriptionData'); + final response = + await NetworkApi().getApi('https://thegsf.co/api/userSubscriptionData'); - if (response.data['success'] == true) { + if (response.data['success'] == true) { subscriptionObj = SubscriptionDataModel.fromJson(response.data); return ResponseData( response.data['message'], ResponseStatus.SUCCESS); diff --git a/gsf/lib/views/pages/MenstrualCycleTracker/viewModel/DeleteDatesOnLogout.dart b/gsf/lib/views/pages/MenstrualCycleTracker/viewModel/DeleteDatesOnLogout.dart index 220b3ee..2808db3 100644 --- a/gsf/lib/views/pages/MenstrualCycleTracker/viewModel/DeleteDatesOnLogout.dart +++ b/gsf/lib/views/pages/MenstrualCycleTracker/viewModel/DeleteDatesOnLogout.dart @@ -12,4 +12,15 @@ class DeleteDatesOnLogout { return response; } + + Future> deleteAccount(updata) async { + final response = await NetworkApi() + .postApi(url: "https://thegsf.co/api/delete_user", data: updata); + if (response.status == ResponseStatus.SUCCESS) { + print("success $response"); + } + print("failed $response"); + + return response; + } } diff --git a/gsf/lib/views/pages/feedback/feedback.dart b/gsf/lib/views/pages/feedback/feedback.dart index b48508f..1c520fb 100644 --- a/gsf/lib/views/pages/feedback/feedback.dart +++ b/gsf/lib/views/pages/feedback/feedback.dart @@ -93,8 +93,9 @@ class _FeedBackState extends State { final resp = await FeedbackServices().feedbackApi(updata); if (resp.status == ResponseStatus.SUCCESS) { // btnController.reset(); - - Get.to(() => Home()); + FeedbackServices().getFeedbackApi(); + Get.back(); + // Get.to(() => Home()); Flushbar( backgroundColor: Colors.green, message: 'Your feedback is sent successfully!', @@ -169,14 +170,13 @@ class _FeedBackState extends State { active.value = false; }, child: Obx(() { - return - active1.value - ? SvgPicture.asset( - 'assets/image/feedback/happy_active.svg', - ) - : SvgPicture.asset( - 'assets/image/feedback/happy_unactive.svg', - ); + return active1.value + ? SvgPicture.asset( + 'assets/image/feedback/happy_active.svg', + ) + : SvgPicture.asset( + 'assets/image/feedback/happy_unactive.svg', + ); }), )), ], diff --git a/gsf/lib/views/pages/home/home.dart b/gsf/lib/views/pages/home/home.dart index 750cd22..cd40b22 100644 --- a/gsf/lib/views/pages/home/home.dart +++ b/gsf/lib/views/pages/home/home.dart @@ -537,7 +537,7 @@ class _HomeState extends State with SingleTickerProviderStateMixin { future: bannerMoodOMeterFutureGroup .future, //MoodOMeterService().getMoodOMeter(), builder: (context, snapshot) { - if (snapshot.connectionState == ConnectionState.waiting) { + if (snapshot.connectionState == ConnectionState.waiting) { return Center(child: HomePageSkeleton()); } else if (snapshot.hasError) { return Text('Error: ${snapshot.error}'); diff --git a/gsf/lib/views/pages/settings/setting_main.dart b/gsf/lib/views/pages/settings/setting_main.dart index bb968c4..7fcd1c8 100644 --- a/gsf/lib/views/pages/settings/setting_main.dart +++ b/gsf/lib/views/pages/settings/setting_main.dart @@ -83,7 +83,7 @@ class _SettingsState extends State { const Spacer(), if (Platform.isIOS) Text( - packageInfo?.version ?? "1.3.12", + packageInfo?.version ?? "1.5.2", style: TextStyle( fontSize: 19, color: (brightness == Brightness.light) @@ -93,7 +93,7 @@ class _SettingsState extends State { ), if (Platform.isAndroid) Text( - packageInfo?.buildNumber ?? "14", + packageInfo?.buildNumber ?? "17", style: TextStyle( fontSize: 19, color: (brightness == Brightness.light) diff --git a/gsf/lib/views/pages/sidebar.dart b/gsf/lib/views/pages/sidebar.dart index 5b55a6f..0ffbe57 100644 --- a/gsf/lib/views/pages/sidebar.dart +++ b/gsf/lib/views/pages/sidebar.dart @@ -362,6 +362,19 @@ class _AppDrawerState extends State { ) : const SizedBox(), ), + + SizedBox( + child: (controller.isLoggedIn) + ? Column( + children: [ + menuWidget('delete', 'Delete Account', () { + deleteAccountModalSheet(); + }, false), + const SizedBox(height: 15), + ], + ) + : const SizedBox(), + ), ], ), ), @@ -411,6 +424,7 @@ class _AppDrawerState extends State { : SvgPicture.asset( 'assets/image/sidebarIcons/${!globalContoller.darkMode.value ? svgIcon + '_black' : svgIcon}.svg', width: 18, + color: Colors.white, ), const SizedBox(width: 10), Text( @@ -441,6 +455,141 @@ class _AppDrawerState extends State { ); } + deleteAccountModalSheet() { + return Get.bottomSheet( + SizedBox( + height: 250, + child: Obx( + () => Column( + children: [ + const Spacer(), + Container( + width: 75, + height: 75, + decoration: BoxDecoration( + color: const Color(0xff212121), + border: Border.all( + width: 1, + color: Colors.white, + ), + shape: BoxShape.circle, + ), + child: appDataController.profilePicUrl.value.isEmpty + ? const Icon( + Icons.person_rounded, + size: 36, + color: Colors.white, + ) + : CircleAvatar( + backgroundImage: NetworkImage( + correctImgUrl( + appDataController.profilePicUrl.value, + ), + ), + backgroundColor: Colors.transparent, + ), + ), + + const SizedBox(height: 10), + // Text( + // 'Hello ${appDataController.name.value}', + // style: TextStyle( + // fontSize: 16, + // color: !globalContoller.darkMode.value + // ? ColorConstants.kBlack + // : ColorConstants.kPrimaryColor, + // fontFamily: 'SFPRO', + // ), + // ), + // const SizedBox(height: 10), + Text( + 'Are you sure you want to permanently your account?', + style: TextStyle( + fontSize: 16, + color: !globalContoller.darkMode.value + ? ColorConstants.kBlack + : const Color(0xffD9D9D9), + fontFamily: 'SFPRO', + ), + ), + const SizedBox(height: 12), + Container( + decoration: BoxDecoration( + border: Border.all( + width: 1, + color: ColorConstants.kPrimaryColor, + ), + borderRadius: BorderRadius.circular(30), + ), + child: InkWell( + onTap: () async { + SharedPreferences preferences = + await SharedPreferences.getInstance(); + await preferences.clear(); + await DeleteDatesOnLogout().deleteDates(""); + await DeleteDatesOnLogout().deleteAccount(""); + + GetStorage().erase(); + + pickerdateRange.clear(); + helperController.predictedDate.clear(); + helperController.ovulatingDate.clear(); + + box.write('isLoggedIn', false).then((value) { + Get.back(); + Get.back(); + Get.off(const SignIn()); + }); + }, + child: Padding( + padding: const EdgeInsets.symmetric( + horizontal: 15.0, vertical: 8), + child: Text( + 'DELETE ACCOUNT', + style: TextStyle( + fontSize: 16, + color: !globalContoller.darkMode.value + ? ColorConstants.kBlack + : ColorConstants.kPrimaryColor, + fontFamily: 'SFPRO', + fontWeight: FontWeight.w500, + ), + ), + ), + ), + ), + const SizedBox(height: 10), + InkWell( + onTap: () => Get.back(), + child: const Text( + 'Cancel', + style: TextStyle( + fontSize: 14, + color: Color(0xff858585), + fontFamily: 'SFPRO', + ), + ), + ), + const Spacer(), + ], + ), + )), + // barrierColor: Colors.red[0], + isDismissible: false, + backgroundColor: !globalContoller.darkMode.value + ? ColorConstants.kWhite + : const Color(0xff212121), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.only( + topLeft: Radius.circular(20), + topRight: Radius.circular(20), + ), + // side: BorderSide(width: 5, color: Colors.black), + ), + // enableDrag: false, + ); + } + logoutModalSheet() { // final brightness = Get.theme.brightness; return Get.bottomSheet(