diff --git a/gsf/lib/modals/blog_model.dart b/gsf/lib/modals/blog_model.dart index c61cccb..f2f4795 100644 --- a/gsf/lib/modals/blog_model.dart +++ b/gsf/lib/modals/blog_model.dart @@ -9,15 +9,15 @@ class BlogModel { success = json['success']; message = json['message']; result = - json['result'] != null ? new Result.fromJson(json['result']) : null; + json['result'] != null ? Result.fromJson(json['result']) : null; } Map toJson() { - final Map data = new Map(); - data['success'] = this.success; - data['message'] = this.message; - if (this.result != null) { - data['result'] = this.result!.toJson(); + final Map data = {}; + data['success'] = success; + data['message'] = message; + if (result != null) { + data['result'] = result!.toJson(); } return data; } @@ -32,15 +32,15 @@ class Result { if (json['category'] != null) { category = []; json['category'].forEach((v) { - category!.add(new Category.fromJson(v)); + category!.add(Category.fromJson(v)); }); } } Map toJson() { - final Map data = new Map(); - if (this.category != null) { - data['category'] = this.category!.map((v) => v.toJson()).toList(); + final Map data = {}; + if (category != null) { + data['category'] = category!.map((v) => v.toJson()).toList(); } return data; } @@ -50,7 +50,7 @@ class Category { int? id; String? categoryName; String? isActive; - Null? deletedAt; + String? deletedAt; String? createdAt; String? updatedAt; List? articles; @@ -74,21 +74,21 @@ class Category { if (json['articles'] != null) { articles = []; json['articles'].forEach((v) { - articles!.add(new Articles.fromJson(v)); + articles!.add(Articles.fromJson(v)); }); } } Map toJson() { - final Map data = new Map(); - data['id'] = this.id; - data['category_name'] = this.categoryName; - data['is_active'] = this.isActive; - data['deleted_at'] = this.deletedAt; - data['created_at'] = this.createdAt; - data['updated_at'] = this.updatedAt; - if (this.articles != null) { - data['articles'] = this.articles!.map((v) => v.toJson()).toList(); + final Map data = {}; + data['id'] = id; + data['category_name'] = categoryName; + data['is_active'] = isActive; + data['deleted_at'] = deletedAt; + data['created_at'] = createdAt; + data['updated_at'] = updatedAt; + if (articles != null) { + data['articles'] = articles!.map((v) => v.toJson()).toList(); } return data; } @@ -105,7 +105,7 @@ class Articles { String? tags; String? thumbnailPath; String? isActive; - Null? deletedAt; + String? deletedAt; String? createdAt; String? updatedAt; @@ -141,20 +141,20 @@ class Articles { } Map toJson() { - final Map data = new Map(); - data['id'] = this.id; - data['category_id'] = this.categoryId; - data['article_name'] = this.articleName; - data['short_text'] = this.shortText; - data['description'] = this.description; - data['image_upload'] = this.imageUpload; - data['video_url'] = this.videoUrl; - data['tags'] = this.tags; - data['thumbnail_path'] = this.thumbnailPath; - data['is_active'] = this.isActive; - data['deleted_at'] = this.deletedAt; - data['created_at'] = this.createdAt; - data['updated_at'] = this.updatedAt; + final Map data = {}; + data['id'] = id; + data['category_id'] = categoryId; + data['article_name'] = articleName; + data['short_text'] = shortText; + data['description'] = description; + data['image_upload'] = imageUpload; + data['video_url'] = videoUrl; + data['tags'] = tags; + data['thumbnail_path'] = thumbnailPath; + data['is_active'] = isActive; + data['deleted_at'] = deletedAt; + data['created_at'] = createdAt; + data['updated_at'] = updatedAt; return data; } } diff --git a/gsf/lib/views/pages/blog/blog_inner.dart b/gsf/lib/views/pages/blog/blog_inner.dart index 96221fb..624d85f 100644 --- a/gsf/lib/views/pages/blog/blog_inner.dart +++ b/gsf/lib/views/pages/blog/blog_inner.dart @@ -53,7 +53,7 @@ class BlogDetails extends StatelessWidget { child: Row( children: [ Text( - tages!, + tages ?? "", style: TextStyle( fontSize: 18, color: ColorConstants.kWhite, @@ -62,7 +62,7 @@ class BlogDetails extends StatelessWidget { ), Spacer(), Text( - formattedtime!, + formattedtime ?? "", style: TextStyle( fontSize: 18, color: ColorConstants.kWhite, diff --git a/gsf/lib/views/pages/blog/blog_main.dart b/gsf/lib/views/pages/blog/blog_main.dart index 585626b..fb998cd 100644 --- a/gsf/lib/views/pages/blog/blog_main.dart +++ b/gsf/lib/views/pages/blog/blog_main.dart @@ -295,7 +295,7 @@ class _NewsBodyState extends State { .result![index].articleName ?? '', image_upload: searchArticle! - .result![index].thumbnailPath ?? + .result![index].imageUpload ?? '', updatedAtTime: formatDateTime2( searchArticle!.result![index] @@ -356,7 +356,7 @@ class _NewsBodyState extends State { .result![index].articleName ?? '', thumbnailimg: searchArticle! - .result![index].thumbnailPath ?? + .result![index].imageUpload ?? '', updatedTime: formatDateTime(searchArticle! .result![index].updatedAt ?? diff --git a/gsf/lib/views/pages/home/home.dart b/gsf/lib/views/pages/home/home.dart index 3c87c64..078185d 100644 --- a/gsf/lib/views/pages/home/home.dart +++ b/gsf/lib/views/pages/home/home.dart @@ -258,7 +258,6 @@ class _HomeState extends State with SingleTickerProviderStateMixin { final TabsController controller = TabsController(); final NavigationCrontroller navController = Get.put(NavigationCrontroller()); - // int _current = 0; final CompleteProfileController completeProfileController = Get.put(CompleteProfileController(), permanent: true); @@ -266,10 +265,7 @@ class _HomeState extends State with SingleTickerProviderStateMixin { var members = memberDetails.map((e) => MeetTheCommunityModel.fromJson(e)).toList(); - // final ManageBanner manageBanners = Get.put(ManageBanner()); - // var homePageApi = FutureGroup(); double textOpacity = 0.0; - // var shortClipNLikesFutureGrp = FutureGroup(); final EditProfileController getProfileDatas = Get.put(EditProfileController()); AppDataController appDataController = Get.find(); @@ -289,8 +285,7 @@ class _HomeState extends State with SingleTickerProviderStateMixin { bannerMoodOMeterFutureGroup.add(FeedbackServices().getFeedbackApi()); QuizeApis().showQuiz(); bannerMoodOMeterFutureGroup.close(); - // print('CURRENT POSITION OF USER ${appDataController.selfPosition.value}'); - // print('feeadback api hit --- $feedbackGetGrp'); + _animationController = AnimationController( duration: const Duration(milliseconds: 600), vsync: this, @@ -301,7 +296,6 @@ class _HomeState extends State with SingleTickerProviderStateMixin { Future.delayed(const Duration(seconds: 1), () { appTourController.startAppTour(context, () { - // Your callback code here setState(() { showMoodOMeterAfterAppTour = false; }); @@ -321,13 +315,6 @@ class _HomeState extends State with SingleTickerProviderStateMixin { Future _getAppVersion() async { PackageInfo packageInfo = await PackageInfo.fromPlatform(); - - // print("current version is ${packageInfo.version}"); - // print("current version is ${packageInfo.appName}"); - // print("current version is ${packageInfo.buildNumber}"); - // print("current version is ${packageInfo.installerStore}"); - - // appUpdateDialog(context); if (Platform.isAndroid) { var updata = {"old_version_android": packageInfo.buildNumber}; final data = await VersionControl().storeCurrentVersion(updata); @@ -474,88 +461,8 @@ class _HomeState extends State with SingleTickerProviderStateMixin { }); } - // permissionDialog() async { - // Map statuses = await [ - // Permission.activityRecognition, - // ].request(); - // if (statuses[Permission.activityRecognition]!.isGranted) { - // initPlatformState(); - // } - // } - - // void initPlatformState() { - // _stepCountStream = Pedometer.stepCountStream; - // _stepCountStream.listen(onStepCount).onError(onStepCountError); - - // if (!mounted) return; - // } - - // When you receive step count updates from the pedometer package: - - // void onStepCount(StepCount event) { - // _steps = event.steps.toString(); - // _appStepCount = _appStepCount + 1; - // stepController.appStepCountGlobal.value = _appStepCount; - // updateAndPersistStepCount(null); - // print("pedometer value ${event.steps}"); - // // Timer.periodic(Duration(minutes: 7), (timer) { - // // Map updata = {"step_count": _appStepCount}; - // // StepCounts().storeSteps(updata); - // // }); - // // Check if the step count is a multiple of 1000 - // if (_appStepCount % 1000 == 0) { - // // Call the API to store steps - // Map updata = {"step_count": _appStepCount}; - // StepCounts().storeSteps(updata); - // } - // } - - // void onStepCountError(error) { - // print('onStepCountError: $error'); - // setState(() { - // _steps = 'Step Count not available'; - // }); - // } - - // // Function to update and persist the step count - // void updateAndPersistStepCount(int? manualCount) async { - // final prefs = await SharedPreferences.getInstance(); - // final currentDateKey = _currentDate - // .toLocal() - // .toString() - // .split(' ')[0]; // Use the date as the key - // prefs.setInt(currentDateKey, manualCount ?? _appStepCount); - // } - -// // Function to check and update the current date -// void checkAndUpdateDate() { -// final today = DateTime.now(); -// if (today.day != _currentDate.day) { -// // The date has changed, reset the step count and update the current date -// updateAndPersistStepCount(0); -// _currentDate = today; -// } -// } - -// // Function to retrieve the step count from storage during app initialization -// void getStepCountFromStorage() async { -// final currentDateKey = _currentDate.toLocal().toString().split(' ')[0]; -// final prefs = await SharedPreferences.getInstance(); -// final storedCount = prefs.getInt(currentDateKey) ?? 0; -// setState(() { -// _appStepCount = storedCount; -// stepController.appStepCountGlobal.value = _appStepCount; -// }); -// } - @override Widget build(BuildContext context) { - // shortClipNLikesFutureGrp.add(shortClipService.fetchShortClips()); - // shortClipNLikesFutureGrp.add(); - // var shortClipService = ShortClipService(); - // shortClipService.fetchShortClipLikes().then((value) => print("KSHAJFHDSJKFHJHFK${value}")); - - // aControllerFind.localWeight.value = GetStorage().read('localWeight') ?? '- -'; aControllerFind.localMusclerate.value = @@ -570,20 +477,10 @@ class _HomeState extends State with SingleTickerProviderStateMixin { aControllerFind.localBmr.value = GetStorage().read('localBmr') ?? '- -'; aControllerFind.localWater.value = GetStorage().read('localWater') ?? '- -'; aControllerFind.localAge.value = GetStorage().read('localAge') ?? '- -'; - // ViewFriendsProfileService() - // .fetchFriendsProfile() - // .then((value) => debugPrint("ViewFriendsProfileService $value")); - // debugPrint( - // 'slected image value ${completeProfileController.selectedImagePath.value}'); - // debugPrint("isLoggedIn: ${controller.isLoggedIn}"); - // debugPrint("isScaled ${GetStorage().read("addScale")}"); - // final brightness = Get.theme.brightness; return Scaffold( floatingActionButton: Visibility(visible: showQuizbool, child: FlotingActionBtn()), - // backgroundColor: - // (brightness == Brightness.light) ? Colors.red : Colors.tealAccent, key: controller.scaffoldKey, drawer: AppDrawer(), appBar: AppBar( @@ -622,11 +519,6 @@ class _HomeState extends State with SingleTickerProviderStateMixin { () => Settings(), ); }, - - // - // Get.to( - // () => const Settings(), - // ), child: Icon( Icons.settings_outlined, color: ColorConstants.kWhite, @@ -652,7 +544,6 @@ class _HomeState extends State with SingleTickerProviderStateMixin { ) ], ), - body: showMoodOMeterAfterAppTour ?? false ? HomePageSkeleton() : FutureBuilder( @@ -660,27 +551,14 @@ class _HomeState extends State with SingleTickerProviderStateMixin { .future, //MoodOMeterService().getMoodOMeter(), builder: (context, snapshot) { if (snapshot.connectionState == ConnectionState.waiting) { - // While waiting for the API response, show a loading indicator return Center(child: HomePageSkeleton()); } else if (snapshot.hasError) { - // If an error occurred during the API call, display an error message return Text('Error: ${snapshot.error}'); } else { if (homeApiController.moodCheckResult == "1") { moodOMeterDialog(context); } - // API call was successful and data is available - // List data = snapshot.data!; - // // Use the fetched data to build your UI - // return ListView.builder( - // itemCount: data.length, - // itemBuilder: (context, index) { - // return ListTile( - // title: Text(data[index]), - // ); - // }, - // ); return AnimatedBuilder( child: GestureDetector( child: Obx( @@ -709,7 +587,6 @@ class _HomeState extends State with SingleTickerProviderStateMixin { } rewardPointDialog(BuildContext context) async { - // AppDataController appDataController = Get.find(); print( 'homeApiController.setMoodResponse.progressBar ${homeApiController.setMoodResponse.progressBar}'); await Future.delayed(Duration(milliseconds: 10)); diff --git a/gsf/lib/views/pages/sidebar.dart b/gsf/lib/views/pages/sidebar.dart index 17a7154..eca8507 100644 --- a/gsf/lib/views/pages/sidebar.dart +++ b/gsf/lib/views/pages/sidebar.dart @@ -136,17 +136,14 @@ class _AppDrawerState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - headTitel('The Podium'), - menuWidget('quiz', 'Quiz Section', () { - FirebaseAnalytics.instance - .logScreenView(screenName: "Quiz"); + // headTitel('The Podium'), + menuWidget('video', 'Profile', () { Get.back(); Get.to( - () => const QuizHome(), + () => const ProfilePage(), ); - }, false), + }, true), const SizedBox(height: 15), - menuWidget('quiz', 'Menstrual cycle tracker', () { FirebaseAnalytics.instance.logScreenView( screenName: "Menstrual cycle tracker"); @@ -160,6 +157,24 @@ class _AppDrawerState extends State { } }, false), const SizedBox(height: 15), + menuWidget('news_articles', 'News & Articles', () { + FirebaseAnalytics.instance + .logScreenView(screenName: "News & Articles"); + Get.to( + () => const BlogMain(), + ); + }, false), + + const SizedBox(height: 15), + // menuWidget('quiz', 'Quiz Section', () { + // FirebaseAnalytics.instance + // .logScreenView(screenName: "Quiz"); + // Get.back(); + // Get.to( + // () => const QuizHome(), + // ); + // }, false), + // const SizedBox(height: 15), // menuWidget('rank', 'LeaderBoard', () { // homePageController.updateBottomNavIndex(3); @@ -189,7 +204,7 @@ class _AppDrawerState extends State { // : const SizedBox(), // ), // const SizedBox(height: 40), - headTitel('External Motivation'), + // headTitel('External Motivation'), menuWidget('podcast', 'Podcasts', () { FirebaseAnalytics.instance .logScreenView(screenName: "Podcasts"); @@ -199,15 +214,6 @@ class _AppDrawerState extends State { }, false), const SizedBox(height: 15), - menuWidget('news_articles', 'News & Articles', () { - FirebaseAnalytics.instance - .logScreenView(screenName: "News & Articles"); - Get.to( - () => const BlogMain(), - ); - }, false), - - const SizedBox(height: 15), // menuWidget( // 'instagram', // 'GSF Instagram Handle', @@ -217,7 +223,7 @@ class _AppDrawerState extends State { // }, // ), // const SizedBox(height: 40), - headTitel('All You need to know'), + // headTitel('All You need to know'), // SizedBox( // child: (controller.isLoggedIn) // ? Column( @@ -229,13 +235,13 @@ class _AppDrawerState extends State { // ) // : const SizedBox(), // ), - menuWidget( - 'about', - 'About GETSETFIT', - () => Get.to( - () => const AboutGSF(), - ), - false), + // menuWidget( + // 'about', + // 'About GETSETFIT', + // () => Get.to( + // () => const AboutGSF(), + // ), + // false), // const SizedBox(height: 15), @@ -246,14 +252,9 @@ class _AppDrawerState extends State { // () => const ProfileSkeleton(), // ), // ), - const SizedBox(height: 15), - menuWidget('video', 'Profile', () { - Get.back(); - Get.to( - () => const ProfilePage(), - ); - }, true), - const SizedBox(height: 15), + // const SizedBox(height: 15), + + // const SizedBox(height: 15), menuWidget('help_info', 'FAQs', () { Get.back(); Get.to( @@ -275,13 +276,13 @@ class _AppDrawerState extends State { // ) // : const SizedBox(), // ), - menuWidget('phone', 'Contact Us', () { - Get.back(); - Get.to( - () => const ContactUs(), - ); - }, false), - const SizedBox(height: 15), + // menuWidget('phone', 'Contact Us', () { + // Get.back(); + // Get.to( + // () => const ContactUs(), + // ); + // }, false), + //const SizedBox(height: 15), menuWidget('phone', 'My Subscription', () { Get.back(); Get.to(