moodometer improved,menstrual fixed
This commit is contained in:
@@ -171,6 +171,7 @@
|
||||
9AD36002AE69EB67FA0E045C /* Frameworks */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
usesTabs = 0;
|
||||
};
|
||||
97C146EF1CF9000F007C117D /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.4.3</string>
|
||||
<string>1.4.4</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleURLTypes</key>
|
||||
@@ -55,6 +55,8 @@
|
||||
<string>Getsetfit use calendar to get current datetime</string>
|
||||
<key>NSCameraUsageDescription</key>
|
||||
<string>To capture profile photo please grant camera access</string>
|
||||
<key>NSFaceIDUsageDescription</key>
|
||||
<string>For user authentication</string>
|
||||
<key>NSHealthShareUsageDescription</key>
|
||||
<string>We will sync your data with the Apple Health app to give you better insights</string>
|
||||
<key>NSHealthUpdateUsageDescription</key>
|
||||
@@ -75,8 +77,6 @@
|
||||
<string>Allow access to photo library</string>
|
||||
<key>NSSpeechRecognitionUsageDescription</key>
|
||||
<string>sprecg</string>
|
||||
<key>NSFaceIDUsageDescription</key>
|
||||
<string>For user authentication</string>
|
||||
<key>UIApplicationSupportsIndirectInputEvents</key>
|
||||
<true/>
|
||||
<key>UIBackgroundModes</key>
|
||||
|
||||
@@ -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<MoodOMeter> createState() => _MoodOMeterState();
|
||||
}
|
||||
@@ -39,31 +38,29 @@ class _MoodOMeterState extends State<MoodOMeter> {
|
||||
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<MoodOMeter> {
|
||||
),
|
||||
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<MoodOMeter> {
|
||||
),
|
||||
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<MoodOMeter> {
|
||||
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<MoodOMeter> {
|
||||
),
|
||||
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
|
||||
|
||||
@@ -51,151 +51,157 @@ class _FirstQuestionState extends State<FirstQuestion> {
|
||||
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,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -50,154 +50,160 @@ class _SecondQuestionState extends State<SecondQuestion> {
|
||||
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,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -28,6 +28,9 @@ class _TrackerHomePageState extends State<TrackerHomePage> {
|
||||
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<TrackerHomePage> {
|
||||
await helperController.calculateFirstTime();
|
||||
await helperController.calculatePeriodDateForCalender();
|
||||
await helperController.calculateOutOfDays();
|
||||
Future.delayed(const Duration(seconds: 1), () {
|
||||
setState(() {});
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
import '../../../../api/base_manager.dart';
|
||||
import '../../../../api/network_api.dart';
|
||||
|
||||
class DeleteDatesOnLogout {
|
||||
Future<ResponseData<dynamic>> 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;
|
||||
}
|
||||
}
|
||||
@@ -13,7 +13,6 @@ import '../../../../api/base_manager.dart';
|
||||
|
||||
QuizeModel? quizData;
|
||||
RxList<PickerDateRange> pickerdateRange = <PickerDateRange>[].obs;
|
||||
|
||||
final HelperMethods helperController = Get.put(HelperMethods());
|
||||
|
||||
class StoringDates {
|
||||
|
||||
@@ -703,18 +703,15 @@ class _HomeState extends State<Home> 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<ResponseModel>(
|
||||
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<Home> 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<Home> 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<Home> with SingleTickerProviderStateMixin {
|
||||
colorText: Colors.white,
|
||||
);
|
||||
} else {
|
||||
calculateMood(activeIndexMoodOMeter);
|
||||
await calculateMood(activeIndexMoodOMeter);
|
||||
box.write('showMoodOmeter', false);
|
||||
Get.back();
|
||||
missionPossible(context);
|
||||
|
||||
@@ -196,7 +196,7 @@ class _CompanyProfileState extends State<CompanyProfile> {
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
const Padding(
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 22.0),
|
||||
child: MoodOMeter(),
|
||||
),
|
||||
|
||||
@@ -453,7 +453,7 @@ class _UserDashboardState extends State<UserDashboard> {
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
const Padding(
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 22),
|
||||
child: MoodOMeter(),
|
||||
),
|
||||
|
||||
@@ -98,7 +98,7 @@ class _ShareThoughtState extends State<ShareThought> {
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
const MoodOMeter(),
|
||||
MoodOMeter(),
|
||||
const SizedBox(height: 35),
|
||||
FullWdtBtn(
|
||||
btnText: 'Share your thoughts!',
|
||||
|
||||
@@ -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<AppDrawer> {
|
||||
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<HelperMethods>();
|
||||
// Get.find<HelperMethods>().onClose();
|
||||
// helperController.dispose();
|
||||
|
||||
pickerdateRange.clear();
|
||||
helperController.predictedDate.clear();
|
||||
helperController.ovulatingDate.clear();
|
||||
|
||||
box.write('isLoggedIn', false).then((value) {
|
||||
Get.back();
|
||||
Get.back();
|
||||
|
||||
Reference in New Issue
Block a user