menstrual design change,step count homepage fix
This commit is contained in:
@@ -58,11 +58,11 @@ android {
|
||||
defaultConfig {
|
||||
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
|
||||
applicationId "com.getsetfit.gsf"
|
||||
// You can update the following values to match your application needs.
|
||||
// You can update the following values to match yourx application needs.
|
||||
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
|
||||
minSdkVersion 26
|
||||
targetSdkVersion 33
|
||||
versionCode 19//flutterVersionCode.toInteger()//3
|
||||
versionCode 21//flutterVersionCode.toInteger()//3
|
||||
versionName "1.0"//flutterVersionName //"1.0"
|
||||
manifestPlaceholders['foregroundServiceType'] = 'health'
|
||||
|
||||
|
||||
@@ -54,9 +54,9 @@ PODS:
|
||||
- FirebaseCoreInternal (~> 10.0)
|
||||
- GoogleUtilities/Environment (~> 7.8)
|
||||
- GoogleUtilities/Logger (~> 7.8)
|
||||
- FirebaseCoreExtension (10.18.0):
|
||||
- FirebaseCoreExtension (10.27.0):
|
||||
- FirebaseCore (~> 10.0)
|
||||
- FirebaseCoreInternal (10.18.0):
|
||||
- FirebaseCoreInternal (10.27.0):
|
||||
- "GoogleUtilities/NSData+zlib (~> 7.8)"
|
||||
- FirebaseCrashlytics (10.17.0):
|
||||
- FirebaseCore (~> 10.5)
|
||||
@@ -66,18 +66,19 @@ PODS:
|
||||
- GoogleUtilities/Environment (~> 7.8)
|
||||
- nanopb (< 2.30910.0, >= 2.30908.0)
|
||||
- PromisesObjC (~> 2.1)
|
||||
- FirebaseInstallations (10.18.0):
|
||||
- FirebaseInstallations (10.27.0):
|
||||
- FirebaseCore (~> 10.0)
|
||||
- GoogleUtilities/Environment (~> 7.8)
|
||||
- GoogleUtilities/UserDefaults (~> 7.8)
|
||||
- PromisesObjC (~> 2.1)
|
||||
- FirebaseSessions (10.18.0):
|
||||
- FirebaseSessions (10.27.0):
|
||||
- FirebaseCore (~> 10.5)
|
||||
- FirebaseCoreExtension (~> 10.0)
|
||||
- FirebaseInstallations (~> 10.0)
|
||||
- GoogleDataTransport (~> 9.2)
|
||||
- GoogleUtilities/Environment (~> 7.10)
|
||||
- nanopb (< 2.30910.0, >= 2.30908.0)
|
||||
- GoogleUtilities/Environment (~> 7.13)
|
||||
- GoogleUtilities/UserDefaults (~> 7.13)
|
||||
- nanopb (< 2.30911.0, >= 2.30908.0)
|
||||
- PromisesSwift (~> 2.1)
|
||||
- Flutter (1.0.0)
|
||||
- flutter_blue_plus (0.0.1):
|
||||
@@ -96,9 +97,9 @@ PODS:
|
||||
- fluttertoast (0.0.2):
|
||||
- Flutter
|
||||
- Toast
|
||||
- FMDB (2.7.5):
|
||||
- FMDB/standard (= 2.7.5)
|
||||
- FMDB/standard (2.7.5)
|
||||
- FMDB (2.7.11):
|
||||
- FMDB/standard (= 2.7.11)
|
||||
- FMDB/standard (2.7.11)
|
||||
- geolocator_apple (1.2.0):
|
||||
- Flutter
|
||||
- GoogleAppMeasurement (10.17.0):
|
||||
@@ -121,29 +122,38 @@ PODS:
|
||||
- GoogleUtilities/Network (~> 7.11)
|
||||
- "GoogleUtilities/NSData+zlib (~> 7.11)"
|
||||
- nanopb (< 2.30910.0, >= 2.30908.0)
|
||||
- GoogleDataTransport (9.2.5):
|
||||
- GoogleDataTransport (9.4.1):
|
||||
- GoogleUtilities/Environment (~> 7.7)
|
||||
- nanopb (< 2.30910.0, >= 2.30908.0)
|
||||
- nanopb (< 2.30911.0, >= 2.30908.0)
|
||||
- PromisesObjC (< 3.0, >= 1.2)
|
||||
- GoogleUtilities/AppDelegateSwizzler (7.12.0):
|
||||
- GoogleUtilities/AppDelegateSwizzler (7.13.3):
|
||||
- GoogleUtilities/Environment
|
||||
- GoogleUtilities/Logger
|
||||
- GoogleUtilities/Network
|
||||
- GoogleUtilities/Environment (7.12.0):
|
||||
- GoogleUtilities/Privacy
|
||||
- GoogleUtilities/Environment (7.13.3):
|
||||
- GoogleUtilities/Privacy
|
||||
- PromisesObjC (< 3.0, >= 1.2)
|
||||
- GoogleUtilities/Logger (7.12.0):
|
||||
- GoogleUtilities/Logger (7.13.3):
|
||||
- GoogleUtilities/Environment
|
||||
- GoogleUtilities/MethodSwizzler (7.12.0):
|
||||
- GoogleUtilities/Privacy
|
||||
- GoogleUtilities/MethodSwizzler (7.13.3):
|
||||
- GoogleUtilities/Logger
|
||||
- GoogleUtilities/Network (7.12.0):
|
||||
- GoogleUtilities/Privacy
|
||||
- GoogleUtilities/Network (7.13.3):
|
||||
- GoogleUtilities/Logger
|
||||
- "GoogleUtilities/NSData+zlib"
|
||||
- GoogleUtilities/Privacy
|
||||
- GoogleUtilities/Reachability
|
||||
- "GoogleUtilities/NSData+zlib (7.12.0)"
|
||||
- GoogleUtilities/Reachability (7.12.0):
|
||||
- "GoogleUtilities/NSData+zlib (7.13.3)":
|
||||
- GoogleUtilities/Privacy
|
||||
- GoogleUtilities/Privacy (7.13.3)
|
||||
- GoogleUtilities/Reachability (7.13.3):
|
||||
- GoogleUtilities/Logger
|
||||
- GoogleUtilities/UserDefaults (7.12.0):
|
||||
- GoogleUtilities/Privacy
|
||||
- GoogleUtilities/UserDefaults (7.13.3):
|
||||
- GoogleUtilities/Logger
|
||||
- GoogleUtilities/Privacy
|
||||
- health (1.0.4):
|
||||
- Flutter
|
||||
- icdevicemanager_flutter (1.0.0):
|
||||
@@ -184,10 +194,10 @@ PODS:
|
||||
- Flutter
|
||||
- permission_handler_apple (9.0.4):
|
||||
- Flutter
|
||||
- PromisesObjC (2.3.1)
|
||||
- PromisesSwift (2.3.1):
|
||||
- PromisesObjC (= 2.3.1)
|
||||
- ReachabilitySwift (5.0.0)
|
||||
- PromisesObjC (2.4.0)
|
||||
- PromisesSwift (2.4.0):
|
||||
- PromisesObjC (= 2.4.0)
|
||||
- ReachabilitySwift (5.2.3)
|
||||
- share_plus (0.0.1):
|
||||
- Flutter
|
||||
- shared_preferences_foundation (0.0.1):
|
||||
@@ -198,7 +208,7 @@ PODS:
|
||||
- FMDB (>= 2.7.5)
|
||||
- syncfusion_flutter_pdfviewer (0.0.1):
|
||||
- Flutter
|
||||
- Toast (4.0.0)
|
||||
- Toast (4.1.1)
|
||||
- TOCropViewController (2.6.1)
|
||||
- uni_links (0.0.1):
|
||||
- Flutter
|
||||
@@ -374,11 +384,11 @@ SPEC CHECKSUMS:
|
||||
firebase_crashlytics: 6a564f58db90be49c49d9ac100bc5cc3fcbf8267
|
||||
FirebaseAnalytics: b9284f9fff10157a843e0422e908711f7bf3b9f2
|
||||
FirebaseCore: 534544dd98cabcf4bf8598d88ec683b02319a528
|
||||
FirebaseCoreExtension: 62b201498aa10535801cdf3448c7f4db5e24ed80
|
||||
FirebaseCoreInternal: 8eb002e564b533bdcf1ba011f33f2b5c10e2ed4a
|
||||
FirebaseCoreExtension: 4ec89dd0c6de93d6becde32122d68b7c35f6bf5d
|
||||
FirebaseCoreInternal: 4b297a2d56063dbea2c1d0d04222d44a8d058862
|
||||
FirebaseCrashlytics: d78651ad7db206ef98269e103ac38d69d569200a
|
||||
FirebaseInstallations: e842042ec6ac1fd2e37d7706363ebe7f662afea4
|
||||
FirebaseSessions: f90fe9212ee2818641eda051c0835c9c4e30d9ae
|
||||
FirebaseInstallations: 766dabca09fd94aef922538aaf144cc4a6fb6869
|
||||
FirebaseSessions: 2fdf949f9e58295a57703ae8f2efc44f9fa3aa16
|
||||
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
|
||||
flutter_blue_plus: 5cb46a0d66c6cacebf7551e0e5a6bfa345ccc224
|
||||
flutter_branch_sdk: cc0393df011973fe6ab0380bc54bce1a3726e8a3
|
||||
@@ -387,11 +397,11 @@ SPEC CHECKSUMS:
|
||||
flutter_native_splash: 52501b97d1c0a5f898d687f1646226c1f93c56ef
|
||||
flutter_pdfview: 25f53dd6097661e6395b17de506e6060585946bd
|
||||
fluttertoast: 48c57db1b71b0ce9e6bba9f31c940ff4b001293c
|
||||
FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
|
||||
FMDB: 57486c1117fd8e0e6b947b2f54c3f42bf8e57a4e
|
||||
geolocator_apple: cc556e6844d508c95df1e87e3ea6fa4e58c50401
|
||||
GoogleAppMeasurement: 4dcddfc7f102825c1c4e6422cb35567b101881a7
|
||||
GoogleDataTransport: 54dee9d48d14580407f8f5fbf2f496e92437a2f2
|
||||
GoogleUtilities: 0759d1a57ebb953965c2dfe0ba4c82e95ccc2e34
|
||||
GoogleDataTransport: 6c09b596d841063d76d4288cc2d2f42cc36e1e2a
|
||||
GoogleUtilities: ea963c370a38a8069cc5f7ba4ca849a60b6d7d15
|
||||
health: 5a380c0f6c4f619535845992993964293962e99e
|
||||
icdevicemanager_flutter: 88e2e000e6de2590bfe51a0af7f8c789d35edc44
|
||||
image_cropper: 60c2789d1f1a78c873235d4319ca0c34a69f2d98
|
||||
@@ -405,14 +415,14 @@ SPEC CHECKSUMS:
|
||||
path_provider_foundation: c68054786f1b4f3343858c1e1d0caaded73f0be9
|
||||
pedometer: 381969883680ade42559782cc41a3bbd453d8234
|
||||
permission_handler_apple: 44366e37eaf29454a1e7b1b7d736c2cceaeb17ce
|
||||
PromisesObjC: c50d2056b5253dadbd6c2bea79b0674bd5a52fa4
|
||||
PromisesSwift: 28dca69a9c40779916ac2d6985a0192a5cb4a265
|
||||
ReachabilitySwift: 985039c6f7b23a1da463388634119492ff86c825
|
||||
PromisesObjC: f5707f49cb48b9636751c5b2e7d227e43fba9f47
|
||||
PromisesSwift: 9d77319bbe72ebf6d872900551f7eeba9bce2851
|
||||
ReachabilitySwift: 7f151ff156cea1481a8411701195ac6a984f4979
|
||||
share_plus: 056a1e8ac890df3e33cb503afffaf1e9b4fbae68
|
||||
shared_preferences_foundation: 986fc17f3d3251412d18b0265f9c64113a8c2472
|
||||
sqflite: 31f7eba61e3074736dff8807a9b41581e4f7f15a
|
||||
syncfusion_flutter_pdfviewer: bb9998884b864cfedf72628df3503bdf57e397c0
|
||||
Toast: 91b396c56ee72a5790816f40d3a94dd357abc196
|
||||
Toast: 1f5ea13423a1e6674c4abdac5be53587ae481c4e
|
||||
TOCropViewController: edfd4f25713d56905ad1e0b9f5be3fbe0f59c863
|
||||
uni_links: d97da20c7701486ba192624d99bffaaffcfc298a
|
||||
url_launcher_ios: 08a3dfac5fb39e8759aeb0abbd5d9480f30fc8b4
|
||||
|
||||
@@ -637,6 +637,8 @@
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
|
||||
CODE_SIGN_IDENTITY = "Apple Development";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
DEVELOPMENT_TEAM = 78P6PBS6GZ;
|
||||
ENABLE_BITCODE = NO;
|
||||
@@ -651,6 +653,7 @@
|
||||
MARKETING_VERSION = 1.3.27;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.getsetfit;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
|
||||
SUPPORTS_MACCATALYST = NO;
|
||||
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
|
||||
@@ -780,6 +783,8 @@
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
|
||||
CODE_SIGN_IDENTITY = "Apple Development";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
DEVELOPMENT_TEAM = 78P6PBS6GZ;
|
||||
ENABLE_BITCODE = NO;
|
||||
@@ -795,6 +800,7 @@
|
||||
MARKETING_VERSION = 1.3.27;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.getsetfit;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
|
||||
SUPPORTS_MACCATALYST = NO;
|
||||
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
|
||||
@@ -815,6 +821,8 @@
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
|
||||
CODE_SIGN_IDENTITY = "Apple Development";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
DEVELOPMENT_TEAM = 78P6PBS6GZ;
|
||||
ENABLE_BITCODE = NO;
|
||||
@@ -829,6 +837,7 @@
|
||||
MARKETING_VERSION = 1.3.27;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.getsetfit;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
|
||||
SUPPORTS_MACCATALYST = NO;
|
||||
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.5.4</string>
|
||||
<string>1.5.11</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleURLTypes</key>
|
||||
@@ -81,6 +81,7 @@
|
||||
<true/>
|
||||
<key>UIBackgroundModes</key>
|
||||
<array>
|
||||
<string>audio</string>
|
||||
<string>processing</string>
|
||||
</array>
|
||||
<key>UILaunchStoryboardName</key>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'dart:async';
|
||||
import 'dart:developer';
|
||||
import 'dart:io';
|
||||
|
||||
// import 'package:firebase_dynamic_links/firebase_dynamic_links.dart';
|
||||
@@ -128,9 +129,14 @@ class _MyAppState extends State<MyApp> {
|
||||
}
|
||||
|
||||
storeSteps() {
|
||||
Timer.periodic(const Duration(minutes: 1), (timer) {
|
||||
Timer.periodic(const Duration(seconds: 30), (timer) {
|
||||
Map<String, dynamic> updata = {"step_count": _appStepCount};
|
||||
StepCounts().storeSteps(updata);
|
||||
|
||||
// log("without condition updatxa ${updata["step_count"]}");
|
||||
// if (updata["step_count"] != 0) {
|
||||
// log("updata ${updata["step_count"]}");
|
||||
// }
|
||||
});
|
||||
}
|
||||
|
||||
@@ -152,28 +158,106 @@ class _MyAppState extends State<MyApp> {
|
||||
}
|
||||
|
||||
int finalSteps = 0;
|
||||
// old step count
|
||||
// void onStepCount(StepCount event) async {
|
||||
// if (_appStepCount == null) {
|
||||
// // Set the initial step count when the stream first emits a value
|
||||
// _storedStepCount = event.steps;
|
||||
// await storeFirstEmittedValueOfDay(_storedStepCount);
|
||||
// int stepsSinceLastStoredCount = event.steps - _storedStepCount;
|
||||
// stepController.appStepCountGlobal.value = stepsSinceLastStoredCount;
|
||||
// updateAndPersistStepCount(stepsSinceLastStoredCount);
|
||||
// _appStepCount = stepsSinceLastStoredCount;
|
||||
// } else {
|
||||
// _storedStepCount = await getFirstEmittedValueOfDay();
|
||||
// finalSteps = event.steps - _storedStepCount;
|
||||
// _appStepCount = finalSteps;
|
||||
// stepController.appStepCountGlobal.value = finalSteps;
|
||||
// }
|
||||
|
||||
// // // 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 onStepCount(StepCount event) async {
|
||||
// if (_appStepCount == null) {
|
||||
// // Set the initial step count when the stream first emits a value
|
||||
// _storedStepCount = event.steps;
|
||||
// await storeFirstEmittedValueOfDay(_storedStepCount);
|
||||
// int stepsSinceLastStoredCount = event.steps - _storedStepCount;
|
||||
// stepController.appStepCountGlobal.value = stepsSinceLastStoredCount;
|
||||
// updateAndPersistStepCount(stepsSinceLastStoredCount);
|
||||
// _appStepCount = stepsSinceLastStoredCount;
|
||||
// } else {
|
||||
|
||||
// _storedStepCount = await getFirstEmittedValueOfDay();
|
||||
// finalSteps = event.steps - _storedStepCount;
|
||||
// _appStepCount = finalSteps;
|
||||
// stepController.appStepCountGlobal.value = finalSteps;
|
||||
// }
|
||||
|
||||
//New Logic 25-Mar-2024
|
||||
if (_appStepCount == null) {
|
||||
// Set the initial step count when the stream first emits a value
|
||||
_storedStepCount = event.steps;
|
||||
await storeFirstEmittedValueOfDay(_storedStepCount);
|
||||
int stepsSinceLastStoredCount = event.steps - _storedStepCount;
|
||||
stepController.appStepCountGlobal.value = stepsSinceLastStoredCount;
|
||||
updateAndPersistStepCount(stepsSinceLastStoredCount);
|
||||
_appStepCount = stepsSinceLastStoredCount;
|
||||
savePrevStepData(event.steps);
|
||||
stepController.appStepCountGlobal.value = 0;
|
||||
_appStepCount = 0;
|
||||
} else {
|
||||
_storedStepCount = await getFirstEmittedValueOfDay();
|
||||
finalSteps = event.steps - _storedStepCount;
|
||||
_appStepCount = finalSteps;
|
||||
stepController.appStepCountGlobal.value = finalSteps;
|
||||
var totalSteps = event.steps;
|
||||
var _currentSteps = await loadCurrentStepData();
|
||||
var _previousSteps = await loadPreviousSteps();
|
||||
if (totalSteps == 0 || totalSteps < _previousSteps) {
|
||||
_previousSteps = totalSteps;
|
||||
savePrevStepData(_previousSteps);
|
||||
}
|
||||
_currentSteps = _currentSteps + (totalSteps - _previousSteps);
|
||||
_previousSteps = totalSteps;
|
||||
saveCurrentStepData(_currentSteps);
|
||||
savePrevStepData(_previousSteps);
|
||||
stepController.appStepCountGlobal.value = _currentSteps;
|
||||
_appStepCount = _currentSteps;
|
||||
}
|
||||
}
|
||||
|
||||
// // 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);
|
||||
// }
|
||||
savePrevStepData(steps) async {
|
||||
final prefs = await SharedPreferences.getInstance();
|
||||
final currentDateKey = _currentDate
|
||||
.toLocal()
|
||||
.toString()
|
||||
.split(' ')[0]; // Use the date as the key
|
||||
prefs.setInt(currentDateKey, steps);
|
||||
}
|
||||
|
||||
loadPreviousSteps() async {
|
||||
final prefs = await SharedPreferences.getInstance();
|
||||
final currentDateKey = _currentDate
|
||||
.toLocal()
|
||||
.toString()
|
||||
.split(' ')[0]; // Use the date as the key
|
||||
return prefs.getInt(currentDateKey);
|
||||
}
|
||||
|
||||
saveCurrentStepData(steps) async {
|
||||
final prefs = await SharedPreferences.getInstance();
|
||||
final currentDateKey = "current" +
|
||||
_currentDate
|
||||
.toLocal()
|
||||
.toString()
|
||||
.split(' ')[0]; // Use the date as the key
|
||||
prefs.setInt(currentDateKey, steps);
|
||||
}
|
||||
|
||||
loadCurrentStepData() async {
|
||||
final prefs = await SharedPreferences.getInstance();
|
||||
final currentDateKey =
|
||||
"current" + _currentDate.toLocal().toString().split(' ')[0];
|
||||
|
||||
var _storedCount = prefs.getInt(currentDateKey);
|
||||
_appStepCount = _storedCount;
|
||||
stepController.appStepCountGlobal.value = _appStepCount ?? 0;
|
||||
return _storedCount ?? 0;
|
||||
}
|
||||
|
||||
storeFirstEmittedValueOfDay(_storedStepCount) async {
|
||||
|
||||
@@ -3,6 +3,7 @@ class Endpoints {
|
||||
static const _staging = "https://gsf.betadelivery.com/api/";
|
||||
|
||||
static const _base = "https://thegsf.co/api/";
|
||||
// static const _base = "https://gsf.betadelivery.com/api/";
|
||||
|
||||
static const login = _base + "login";
|
||||
static const generateOtp = _base + "otp/generate";
|
||||
|
||||
@@ -5,8 +5,7 @@ import '../api/base_manager.dart';
|
||||
|
||||
class StepCounts {
|
||||
Future<ResponseData<dynamic>> storeSteps(updata) async {
|
||||
final response =
|
||||
await NetworkApi().postApi(url: Endpoints.storeSteps, data: updata);
|
||||
final response = await NetworkApi().postApi(url: Endpoints.storeSteps, data: updata);
|
||||
print("response from step count $response");
|
||||
return response;
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ class HelperMethods extends GetxController {
|
||||
RxString observableDateTimeOnTrackerHomePage =
|
||||
DateFormat('dd MMMM').format(DateTime.now()).obs;
|
||||
Rx<DateTime?> updateDateForHomepage = DateTime.now().obs;
|
||||
|
||||
RxBool overviewButtonColorTransparent = false.obs;
|
||||
changeObservableDateTimeOnTrackerHomePage(bool front) {
|
||||
DateTime currentDate =
|
||||
DateFormat('dd MMMM').parse(observableDateTimeOnTrackerHomePage.value);
|
||||
|
||||
@@ -382,6 +382,13 @@ class _TrackerHomePageState extends State<TrackerHomePage> {
|
||||
() {
|
||||
if (helperController.ovulatingDate.contains(
|
||||
helperController.updateDateForHomepage.value)) {
|
||||
Future.delayed(const Duration(milliseconds: 500),
|
||||
() {
|
||||
helperController.overviewButtonColorTransparent
|
||||
.value = true;
|
||||
});
|
||||
helperController
|
||||
.overviewButtonColorTransparent.value = true;
|
||||
return Image.asset(
|
||||
'assets/image/MCT_purple_new.png',
|
||||
width: 156,
|
||||
@@ -389,18 +396,32 @@ class _TrackerHomePageState extends State<TrackerHomePage> {
|
||||
);
|
||||
} else if (helperController.allDatesList.contains(
|
||||
helperController.updateDateForHomepage.value)) {
|
||||
Future.delayed(const Duration(milliseconds: 500),
|
||||
() {
|
||||
helperController.overviewButtonColorTransparent
|
||||
.value = true;
|
||||
});
|
||||
return Image.asset(
|
||||
'assets/image/MCT_red_new.png',
|
||||
width: 156,
|
||||
height: 156,
|
||||
);
|
||||
} else if (helperController.disabledNext.value) {
|
||||
Future.delayed(const Duration(milliseconds: 500),
|
||||
() {
|
||||
helperController.overviewButtonColorTransparent
|
||||
.value = false;
|
||||
});
|
||||
return Image.asset(
|
||||
'assets/image/MCT_disabled_center_new.png',
|
||||
width: 156,
|
||||
height: 156,
|
||||
);
|
||||
} else {
|
||||
// Future.delayed(const Duration(seconds: 1), () {
|
||||
// helperController.overviewButtonColorTransparent
|
||||
// .value = false; // Prints after 1 second.
|
||||
// });
|
||||
return Image.asset(
|
||||
'assets/image/Icon5MCT_new.png',
|
||||
width: 156,
|
||||
@@ -447,7 +468,10 @@ class _TrackerHomePageState extends State<TrackerHomePage> {
|
||||
],
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
Obx(
|
||||
() => helperController
|
||||
.overviewButtonColorTransparent.value
|
||||
? Positioned(
|
||||
bottom: 45,
|
||||
right: 47,
|
||||
child: InkWell(
|
||||
@@ -463,6 +487,38 @@ class _TrackerHomePageState extends State<TrackerHomePage> {
|
||||
),
|
||||
),
|
||||
)
|
||||
: Positioned(
|
||||
bottom: 40,
|
||||
right: 41,
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: const Color(0xFFBBF046),
|
||||
borderRadius: BorderRadius.circular(
|
||||
20.0), // Adjust the radius as needed
|
||||
border: Border.all(
|
||||
color: const Color(
|
||||
0xFFBBF046), // Border color
|
||||
),
|
||||
),
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
Get.to(() => const OverviewPage());
|
||||
},
|
||||
child: const Padding(
|
||||
padding: EdgeInsets.all(
|
||||
4), // Adjust padding as needed
|
||||
child: Text(
|
||||
"Overview",
|
||||
style: TextStyle(
|
||||
color: Color.fromRGBO(0, 0, 0, 1),
|
||||
fontSize: 14,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
Obx(() => helperController.showNext.value
|
||||
@@ -497,7 +553,7 @@ class _TrackerHomePageState extends State<TrackerHomePage> {
|
||||
Obx(() => !helperController.endOfCycle.value
|
||||
? const Text("Start of new Cycle")
|
||||
: helperController.disabledNext.value
|
||||
? const Text("Not tracking")
|
||||
? const Text("Enter Latest Dates")
|
||||
: const Text("")),
|
||||
const SizedBox(
|
||||
height: 80,
|
||||
|
||||
@@ -99,7 +99,7 @@ class calculateStepsFromHealthApp extends GetxController {
|
||||
|
||||
Future storeStepsInDB() async {
|
||||
Map<String, dynamic> updata = {"step_count": finalSteps.value};
|
||||
StepCounts().storeSteps(updata);
|
||||
await StepCounts().storeSteps(updata);
|
||||
}
|
||||
|
||||
Future fetchStepDataForAndroid() async {
|
||||
|
||||
@@ -55,7 +55,6 @@ class _HomePageState extends State<HomePage> {
|
||||
listenDynamicLinks();
|
||||
callingBannerApiForHomeScreen();
|
||||
analytics.setAnalyticsCollectionEnabled(true);
|
||||
|
||||
super.initState();
|
||||
}
|
||||
|
||||
|
||||
@@ -52,7 +52,9 @@ class _MVPelitesBoardState extends State<MVPelitesBoard>
|
||||
void _startTimer() {
|
||||
_timer = Timer.periodic(Duration(seconds: 25), (Timer timer) async {
|
||||
if (Platform.isIOS) {
|
||||
await stepscontroller.storeStepsInDB();
|
||||
await stepscontroller
|
||||
.fetchStepData()
|
||||
.then((value) => stepscontroller.storeStepsInDB());
|
||||
}
|
||||
|
||||
setState(() {});
|
||||
@@ -64,7 +66,9 @@ class _MVPelitesBoardState extends State<MVPelitesBoard>
|
||||
super.initState();
|
||||
_startTimer();
|
||||
if (Platform.isIOS) {
|
||||
stepscontroller.storeStepsInDB();
|
||||
stepscontroller
|
||||
.fetchStepData()
|
||||
.then((value) => stepscontroller.storeStepsInDB());
|
||||
}
|
||||
_animationController = AnimationController(
|
||||
value: 0.0,
|
||||
|
||||
@@ -125,9 +125,9 @@ class _UserDashboardState extends State<UserDashboard> {
|
||||
],
|
||||
];
|
||||
|
||||
// if (Platform.isIOS) {
|
||||
// _startTimer();
|
||||
// }
|
||||
if (Platform.isIOS) {
|
||||
_executeStoringOfSteps();
|
||||
}
|
||||
|
||||
// if (Platform.isAndroid) {
|
||||
// permissionDialog();
|
||||
@@ -152,6 +152,11 @@ class _UserDashboardState extends State<UserDashboard> {
|
||||
// stepscontroller.fetchStepData();
|
||||
// });
|
||||
// }
|
||||
_executeStoringOfSteps() async {
|
||||
await stepscontroller
|
||||
.fetchStepData()
|
||||
.then((value) => stepscontroller.storeStepsInDB());
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
|
||||
@@ -28,8 +28,7 @@ class _ProfileSliderState extends State<ProfileSlider> {
|
||||
}
|
||||
|
||||
int _current = 0;
|
||||
final ProfileSliderController slidercontrollers =
|
||||
Get.put(ProfileSliderController());
|
||||
final ProfileSliderController slidercontrollers = Get.put(ProfileSliderController());
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
||||
@@ -83,7 +83,7 @@ class _SettingsState extends State<Settings> {
|
||||
const Spacer(),
|
||||
if (Platform.isIOS)
|
||||
Text(
|
||||
packageInfo?.version ?? "1.5.3",
|
||||
packageInfo?.version ?? "1.5.10",
|
||||
style: TextStyle(
|
||||
fontSize: 19,
|
||||
color: (brightness == Brightness.light)
|
||||
@@ -93,7 +93,7 @@ class _SettingsState extends State<Settings> {
|
||||
),
|
||||
if (Platform.isAndroid)
|
||||
Text(
|
||||
packageInfo?.buildNumber ?? "18",
|
||||
packageInfo?.buildNumber ?? "21",
|
||||
style: TextStyle(
|
||||
fontSize: 19,
|
||||
color: (brightness == Brightness.light)
|
||||
|
||||
Reference in New Issue
Block a user