home page dead code removed

This commit is contained in:
kishan06
2024-04-22 15:07:54 +05:30
parent 20ecfb069d
commit b18717188f

View File

@@ -258,7 +258,6 @@ class _HomeState extends State<Home> 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<Home> 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<Home> 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<Home> 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<Home> with SingleTickerProviderStateMixin {
Future<void> _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<Home> with SingleTickerProviderStateMixin {
});
}
// permissionDialog() async {
// Map<Permission, PermissionStatus> 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<String, dynamic> 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<String, dynamic> 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<Home> 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<Home> with SingleTickerProviderStateMixin {
() => Settings(),
);
},
//
// Get.to(
// () => const Settings(),
// ),
child: Icon(
Icons.settings_outlined,
color: ColorConstants.kWhite,
@@ -652,7 +544,6 @@ class _HomeState extends State<Home> with SingleTickerProviderStateMixin {
)
],
),
body: showMoodOMeterAfterAppTour ?? false
? HomePageSkeleton()
: FutureBuilder(
@@ -660,27 +551,14 @@ class _HomeState extends State<Home> 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<String> 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<Home> with SingleTickerProviderStateMixin {
}
rewardPointDialog(BuildContext context) async {
// AppDataController appDataController = Get.find();
print(
'homeApiController.setMoodResponse.progressBar ${homeApiController.setMoodResponse.progressBar}');
await Future.delayed(Duration(milliseconds: 10));