Merge branch 'development_new_design_2.0' of https://gitlab.com/Cloud_Solution/diplomatic-quarter into nov_fixes

merge-requests/502/head
Elham Rababh 3 years ago
commit 45d167fc5e

@ -1631,10 +1631,50 @@ const Map localizedValues = {
"RRTTitle": {"en": "RRT", "ar": "خدمة فريق"}, "RRTTitle": {"en": "RRT", "ar": "خدمة فريق"},
"RRTSubTitle": {"en": "Service", "ar": "الاستجابة السريع"}, "RRTSubTitle": {"en": "Service", "ar": "الاستجابة السريع"},
"transportation": {"en": "Transportation", "ar": "النقل"}, "transportation": {"en": "Transportation", "ar": "النقل"},
"neck": {"en": "Neck", "ar": "رقبه"}, "neck": {"en": "Neck", "ar": "رقبه"},
"waist": {"en": "Waist", "ar": "وسط"}, "waist": {"en": "Waist", "ar": "وسط"},
"hip": {"en": "Hip", "ar": "ورك او نتوء"}, "hip": {"en": "Hip", "ar": "ورك او نتوء"},
"carbsProtin": {"en": "Carbs, Protein and Fat", "ar": "الكربوهيدرات والبروتينات والدهون"}, "carbsProtin": {"en": "Carbs, Protein and Fat", "ar": "الكربوهيدرات والبروتينات والدهون"},
"usefulInfo": {"en": "Useful Information", "ar": "Useful Information"},
"babyAge": {"en": "Baby Age", "ar": "عمر الطفل الآن:"},
"babyAgeAvail": {"en": "baby age is not available", "ar": "عمر الطفل غير متوفر"},
"deliveryDue": {"en": "The delivery due date is estimated to be on the", "ar": "من المقدر أن يكون تاريخ استحقاق التسليم في"},
"almostInactive": {"en": "Almost Inactive(Little or no exercises)", "ar": "شبه غير نشط (تمارين قليلة أو معدومة)"},
"lightActive1": {"en": "Lighty Active (1-3) days per week", "ar": "Lighty Active (1-3) أيام في الأسبوع"},
"veryActive": {"en": "very Active(6-7) days per week", "ar": "نشط جدا (6-7) أيام في الأسبوع"},
"superActive": {"en": "Super Active(very hard exercises)", "ar": "سوبر نشط (تمارين صعبة للغاية)"},
"dailyIntake": {"en": "Daily intake is", "ar": "المدخول اليومي"},
"calculateAmount": {"en": "Calculates the amount of energy that the persons body expends in a day", "ar": "تحسب كمية الطاقة التي يبذلها جسم الشخص في اليوم"},
"bodyWillBurn": {"en": "This means the body will burn", "ar": "هذا يعني أن الجسم سوف يحترق"},
"caloriesEachDay": {"en": "calories each day, if engaged in no activity for the entire day.. Note: Daily calorie requirement is", "ar": "السعرات الحرارية في كل يوم ، إذا لم تمارس أي نشاط طوال اليوم .. ملاحظة: متطلبات السعرات الحرارية اليومية هي"},
"maintainWeight": {"en": "calories, to maintain the current weight.", "ar": "السعرات الحرارية للحفاظ على الوزن الحالي."},
"mediumFinger": {"en": "Medium(fingers touch)", "ar": "متوسطة (لمسة الأصابع)"},
"smallFinger": {"en": "Small(fingers overlap)", "ar": "صغير (أصابع متداخلة)"},
"largeFinger": {"en": "Large(fingers don\'n touch)", "ar": "كبير (لا تلمس الأصابع)"},
"idealBodyWeight": {"en": "Calculates the ideal body weight based on height, Weight, and Body Size", "ar": "يحسب وزن الجسم المثالي بناءً على الطول والوزن وحجم الجسم"},
"bodyFrameSize": {"en": "Body Frame Size", "ar": "حجم إطار الجسم"},
"idealWeightRange": {"en": "Ideal weight range is", "ar": "نطاق الوزن المثالي هو"},
"currentWeightPerfect": {"en": "Congratulations! The current weight is perfect and considered healthy", "ar": "تهانينا! الوزن الحالي مثالي ويعتبر صحي"},
"littleBitWeightMore": {"en": "This means that the weight is a little bit more than ideal weight by", "ar": "هذا يعني أن الوزن أكثر قليلاً من الوزن المثالي به"},
"consultWithDoctor": {"en": "May wish to consult with the doctor for medical help. Click to view our list of Doctors", "ar": "قد ترغب في استشارة الطبيب للحصول على مساعدة طبية. انقر لعرض قائمة الأطباء لدينا"},
"excessiveObesity": {"en": "Means that you suffer from excessive obesity by", "ar": "يعني أنك تعاني من السمنة المفرطة بها"},
"mayWish": {"en": "May wish to consult with the doctor for medical help. Click to view our list of\n Doctors", "ar": "قد ترغب في استشارة الطبيب للحصول على مساعدة طبية. انقر لعرض قائمة الأطباء \ n الخاصة بنا"},
"essential": {"en": "The category falls under essential", "ar": "الفئة تندرج تحت الأساسية"},
"athlete": {"en": "The category falls under athlete", "ar": "فئة تندرج تحت رياضي"},
"fitness": {"en": "The category falls under fitness", "ar": "الفئة تندرج تحت اللياقة البدنية"},
"acceptable": {"en": "The category falls under acceptable", "ar": "الفئة تندرج تحت مقبول"},
"underObese": {"en": "The category falls under obese", "ar": "تندرج الفئة تحت السمنة"},
"crossedLimits": {"en": "Please check the value you have entered, since the body fat percentage has crosed the limits.", "ar": "يرجى التحقق من القيمة التي أدخلتها ، لأن نسبة الدهون في الجسم تجاوزت الحدود."},
"lowLimits": {"en": "Please check the value you have entered, since the body fat percentage cannot be this low.", "ar": "يرجى التحقق من القيمة التي أدخلتها ، حيث لا يمكن أن تكون نسبة الدهون في الجسم منخفضة."},
"estimates": {"en": "Estimates the total body fat based on\nthe size", "ar": "تقدير إجمالي الدهون في الجسم بناءً على \ n الحجم"},
"myCart": {"en": "Cart", "ar": "عربة التسوق"}, "myCart": {"en": "Cart", "ar": "عربة التسوق"},
"browseOffers": {"en": "Browse offers by clinic", "ar": "تصفح العروض حسب العيادة"}, "browseOffers": {"en": "Browse offers by clinic", "ar": "تصفح العروض حسب العيادة"},
"inactiveAct":{"en":"Almost inactive (little or no exercise)","ar":"غير نشط تقريبا (ممارسة الرياضة قليلة أو منعدمة)"}, "inactiveAct":{"en":"Almost inactive (little or no exercise)","ar":"غير نشط تقريبا (ممارسة الرياضة قليلة أو منعدمة)"},
@ -1650,10 +1690,7 @@ const Map localizedValues = {
"bodyFrameMedium": {"en": "Medium (fingers touch)", "ar": "متوسط (الأصابع تتلامس)"}, "bodyFrameMedium": {"en": "Medium (fingers touch)", "ar": "متوسط (الأصابع تتلامس)"},
"bodyFrameLarge": {"en": "Large (fingers don't touch)", "ar": "عريض (الأصابع لا تتلامس)"}, "bodyFrameLarge": {"en": "Large (fingers don't touch)", "ar": "عريض (الأصابع لا تتلامس)"},
"bodyFatDesc": {"en": "Estimates the total body fat based on the size", "ar": "حساب الدهون في الجسم بناءاً على الحجم"}, "bodyFatDesc": {"en": "Estimates the total body fat based on the size", "ar": "حساب الدهون في الجسم بناءاً على الحجم"},
"essential":{"en":"The category falls under Essential Fat.","ar":"تندرج تحت فئة دهون أساسية"},
"athlete":{"en":" The category falls under Athlete.","ar":"تندرج تحت فئة دهون جسم رياضي"},
"fitness":{"en":" The category falls under Fitness.","ar":"تندرج تحت فئة دهون جسم صحي"},
"acceptable":{"en":"The category falls under Acceptable","ar":"تندرج تحت فئة دهون مقبولة"},
"obeseBodyFat":{"en":"The category falls under Obese.","ar":"تندرج تحت فئة دهون جسم سمين"}, "obeseBodyFat":{"en":"The category falls under Obese.","ar":"تندرج تحت فئة دهون جسم سمين"},
"invalid":{"en":"Invalid input for calculation.","ar":"البيانات المدخلة غير صالحة للحساب"}, "invalid":{"en":"Invalid input for calculation.","ar":"البيانات المدخلة غير صالحة للحساب"},
"more":{"en":"Please check the value you have entered, since the body fat percentage has crossed the limits.","ar":"يرجى التحقق من القيمة التي أدخلتها ، نظرًا لأن نسبة الدهون في الجسم قد تجاوزت الحدود"}, "more":{"en":"Please check the value you have entered, since the body fat percentage has crossed the limits.","ar":"يرجى التحقق من القيمة التي أدخلتها ، نظرًا لأن نسبة الدهون في الجسم قد تجاوزت الحدود"},
@ -1667,4 +1704,5 @@ const Map localizedValues = {
"dietModerate":{"en":"Moderate Carb","ar":"حمية معتدلة الكربوهيدرات"}, "dietModerate":{"en":"Moderate Carb","ar":"حمية معتدلة الكربوهيدرات"},
"dietUSDA":{"en":"USDA Guidelines","ar":"ارشادات وزارة الزراعة الأمريكية"}, "dietUSDA":{"en":"USDA Guidelines","ar":"ارشادات وزارة الزراعة الأمريكية"},
"dietZone":{"en":"Zone Diet","ar":"حمية زون"}, "dietZone":{"en":"Zone Diet","ar":"حمية زون"},
}; };

@ -25,6 +25,9 @@ class SendActivationRequest {
String dob; String dob;
int isHijri; int isHijri;
String healthId; String healthId;
int responseID;
int status;
SendActivationRequest( SendActivationRequest(
{this.patientMobileNumber, {this.patientMobileNumber,
this.mobileNo, this.mobileNo,
@ -51,7 +54,9 @@ class SendActivationRequest {
this.sMSSignature, this.sMSSignature,
this.dob, this.dob,
this.isHijri, this.isHijri,
this.healthId}); this.healthId,
this.responseID,
this.status});
SendActivationRequest.fromJson(Map<String, dynamic> json) { SendActivationRequest.fromJson(Map<String, dynamic> json) {
patientMobileNumber = json['PatientMobileNumber']; patientMobileNumber = json['PatientMobileNumber'];
@ -80,6 +85,8 @@ class SendActivationRequest {
dob = json['DOB']; dob = json['DOB'];
isHijri = json['IsHijri']; isHijri = json['IsHijri'];
healthId = json['HealthId']; healthId = json['HealthId'];
responseID = json['ReponseID'];
status = json['Status'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -110,6 +117,8 @@ class SendActivationRequest {
data['DOB'] = dob; data['DOB'] = dob;
data['IsHijri'] = isHijri; data['IsHijri'] = isHijri;
data['HealthId'] = healthId; data['HealthId'] = healthId;
data['ResponseID'] = responseID;
data['Status'] = status;
return data; return data;
} }
} }

@ -2,7 +2,8 @@ import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -48,7 +49,7 @@ class _BmrCalculatorState extends State<BmrCalculator> {
// int height = 0; // int height = 0;
// int weight = 0; // int weight = 0;
double bmrResult = 0; double bmrResult = 0;
String dropdownValue = ''; String dropdownValue = null;
double calories = 0; double calories = 0;
void updateColor(int type) { void updateColor(int type) {
@ -121,14 +122,14 @@ class _BmrCalculatorState extends State<BmrCalculator> {
bmrResult = bmrResult.roundToDouble(); bmrResult = bmrResult.roundToDouble();
} }
void calculateCalories() { void calculateCalories(BuildContext context) {
if (dropdownValue == TranslationBase.of(context).inactiveAct) { if (dropdownValue == TranslationBase.of(context).almostInactive) {
calories = bmrResult * 1.2; calories = bmrResult * 1.2;
} else if (dropdownValue == TranslationBase.of(context).light) { } else if (dropdownValue == TranslationBase.of(context).lightActive1) {
calories = bmrResult * 1.375; calories = bmrResult * 1.375;
} else if (dropdownValue == TranslationBase.of(context).very) { } else if (dropdownValue == TranslationBase.of(context).veryActive) {
calories = bmrResult * 1.55; calories = bmrResult * 1.55;
} else if (dropdownValue == TranslationBase.of(context).superAct) { } else if (dropdownValue == TranslationBase.of(context).superActive) {
calories = bmrResult * 1.725; calories = bmrResult * 1.725;
} else if (dropdownValue == "") { } else if (dropdownValue == "") {
calories = bmrResult * 10.725; calories = bmrResult * 10.725;
@ -137,7 +138,7 @@ class _BmrCalculatorState extends State<BmrCalculator> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
dropdownValue = TranslationBase.of(context).light; if (dropdownValue == null) dropdownValue = TranslationBase.of(context).lightActive1;
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
_weightPopupList = <PopupMenuItem>[PopupMenuItem(child: Text(TranslationBase.of(context).kg), value: true), PopupMenuItem(child: Text(TranslationBase.of(context).lb), value: false)]; _weightPopupList = <PopupMenuItem>[PopupMenuItem(child: Text(TranslationBase.of(context).kg), value: true), PopupMenuItem(child: Text(TranslationBase.of(context).lb), value: false)];
_heightPopupList = <PopupMenuItem>[PopupMenuItem(child: Text(TranslationBase.of(context).cm), value: true), PopupMenuItem(child: Text(TranslationBase.of(context).ft), value: false)]; _heightPopupList = <PopupMenuItem>[PopupMenuItem(child: Text(TranslationBase.of(context).cm), value: true), PopupMenuItem(child: Text(TranslationBase.of(context).ft), value: false)];
@ -148,7 +149,16 @@ class _BmrCalculatorState extends State<BmrCalculator> {
showNewAppBarTitle: true, showNewAppBarTitle: true,
showNewAppBar: true, showNewAppBar: true,
appBarTitle: TranslationBase.of(context).bmr, appBarTitle: TranslationBase.of(context).bmr,
showHomeAppBarIcon: true, showHomeAppBarIcon: false,
appBarIcons: [
Padding(
padding: const EdgeInsets.symmetric(horizontal: 10.0, vertical: 7.0),
child: Icon(
Icons.info_outline,
color: Colors.white,
),
)
],
body: Container( body: Container(
height: double.infinity, height: double.infinity,
width: double.infinity, width: double.infinity,
@ -162,7 +172,7 @@ class _BmrCalculatorState extends State<BmrCalculator> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( Text(
TranslationBase.of(context).bmrDesc, TranslationBase.of(context).calculateAmount,
style: TextStyle( style: TextStyle(
fontSize: 14, fontSize: 14,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
@ -363,14 +373,14 @@ class _BmrCalculatorState extends State<BmrCalculator> {
}); });
}, },
items: <String>[ items: <String>[
TranslationBase.of(context).inactiveAct, TranslationBase.of(context).almostInactive,
TranslationBase.of(context).light, TranslationBase.of(context).lightActive1,
TranslationBase.of(context).very, TranslationBase.of(context).veryActive,
TranslationBase.of(context).superAct, TranslationBase.of(context).superActive
].map<DropdownMenuItem<String>>((String value) { ].map<DropdownMenuItem<String>>((String value) {
return DropdownMenuItem<String>( return DropdownMenuItem<String>(
value: value, value: value,
child: Text(value, style: TextStyle(fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins', fontSize: 11, letterSpacing: -0.44, fontWeight: FontWeight.w600)), child: Text(value),
); );
}).toList(), }).toList(),
), ),
@ -397,12 +407,14 @@ class _BmrCalculatorState extends State<BmrCalculator> {
Container( Container(
margin: EdgeInsets.symmetric(horizontal: 16.0, vertical: 16.0), margin: EdgeInsets.symmetric(horizontal: 16.0, vertical: 16.0),
color: Colors.white, color: Colors.white,
child: DefaultButton( child: SecondaryButton(
TranslationBase.of(context).calculate, label: TranslationBase.of(context).calculate,
() { color: CustomColors.accentColor,
onTap: () {
setState(() { setState(() {
calculateBmr(); calculateBmr();
calculateCalories(); calculateCalories(context);
{ {
Navigator.push( Navigator.push(
context, context,

@ -5,7 +5,9 @@ import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -24,7 +26,6 @@ class BmrResultPage extends StatelessWidget {
isShowDecPage: false, isShowDecPage: false,
showNewAppBarTitle: true, showNewAppBarTitle: true,
showNewAppBar: true, showNewAppBar: true,
showHomeAppBarIcon: true,
appBarTitle: TranslationBase.of(context).bmr, appBarTitle: TranslationBase.of(context).bmr,
body: Column( body: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly, mainAxisAlignment: MainAxisAlignment.spaceEvenly,
@ -36,7 +37,7 @@ class BmrResultPage extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( Text(
"Calories", TranslationBase.of(context).calories,
style: TextStyle( style: TextStyle(
fontSize: 19, fontSize: 19,
letterSpacing: -1.34, letterSpacing: -1.34,
@ -64,7 +65,7 @@ class BmrResultPage extends StatelessWidget {
height: 5.0, height: 5.0,
), ),
Text( Text(
'Calories', TranslationBase.of(context).calories,
style: TextStyle( style: TextStyle(
fontSize: 18, fontSize: 18,
letterSpacing: -1.08, letterSpacing: -1.08,
@ -79,23 +80,31 @@ class BmrResultPage extends StatelessWidget {
), ),
mHeight(20), mHeight(20),
Text( Text(
'This means the body will burn (${bmrResult.toStringAsFixed(1)}) calories each day, if engaged in no activity for the entire day.. Note: Daily calorie requirement is (${calories.toStringAsFixed(1)}) calories, to maintain the current weight.', TranslationBase.of(context).bodyWillBurn+' ( ${bmrResult.toStringAsFixed(1)} )'+TranslationBase.of(context).caloriesEachDay+'( ${calories.toStringAsFixed(1)} ) '+TranslationBase.of(context).maintainWeight,
style: TextStyle(fontSize: 14, letterSpacing: -0.56, fontWeight: FontWeight.w600, color: CustomColors.textColor), style: TextStyle(
fontSize: 14,
letterSpacing: -0.56,
fontWeight: FontWeight.w600,
color: CustomColors.textColor
),
), ),
], ],
).withBorderedContainer, ).withBorderedContainer,
), ),
mFlex(1), mFlex(1),
Container( Container(
margin: EdgeInsets.symmetric(horizontal: 16.0, vertical: 16.0), margin: EdgeInsets.symmetric(horizontal: 16.0, vertical: 16.0),
color: Colors.white, color: Colors.white,
child: DefaultButton( child: SecondaryButton(
TranslationBase.of(context).viewDocList, label: TranslationBase.of(context).viewDocList,
() { color: CustomColors.accentColor,
onTap: () {
getDoctorsList(context); getDoctorsList(context);
}, },
), ),
), ),
], ],
), ),
); );
@ -154,19 +163,18 @@ class BmrResultPage extends StatelessWidget {
}); });
} }
} }
extension BorderedContainer on Widget { extension BorderedContainer on Widget {
Widget get withBorderedContainer => Container( Widget get withBorderedContainer => Container(
padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15), padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
alignment: Alignment.center, alignment: Alignment.center,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15), borderRadius: BorderRadius.circular(15),
color: Colors.white, color: Colors.white,
border: Border.all( border: Border.all(
color: Color(0xffefefef), color: Color(0xffefefef),
width: 1, width: 1,
), ),
), ),
child: this, child: this,
); );
} }

@ -175,7 +175,7 @@ class _BodyFatState extends State<BodyFat> {
} }
} }
void showTextResult() { void showTextResult(BuildContext context) {
if (isMale == false) { if (isMale == false) {
if (bodyFat > 9 && bodyFat <= 13) { if (bodyFat > 9 && bodyFat <= 13) {
textResult = TranslationBase.of(context).essential; textResult = TranslationBase.of(context).essential;
@ -186,11 +186,11 @@ class _BodyFatState extends State<BodyFat> {
} else if (bodyFat > 24 && bodyFat <= 31) { } else if (bodyFat > 24 && bodyFat <= 31) {
textResult = TranslationBase.of(context).acceptable; textResult = TranslationBase.of(context).acceptable;
} else if (bodyFat > 31 && bodyFat <= 60) { } else if (bodyFat > 31 && bodyFat <= 60) {
textResult = TranslationBase.of(context).obeseBodyFat; textResult = TranslationBase.of(context).underObese;
} else if (bodyFat > 60) { } else if (bodyFat > 60) {
textResult = TranslationBase.of(context).more; textResult = TranslationBase.of(context).crossedLimits;
} else if (bodyFat <= 9) { } else if (bodyFat <= 9) {
textResult = TranslationBase.of(context).less; textResult = TranslationBase.of(context).lowLimits;
} }
} else { } else {
if (bodyFat > 5 && fat <= 13) { if (bodyFat > 5 && fat <= 13) {
@ -200,11 +200,11 @@ class _BodyFatState extends State<BodyFat> {
} else if (bodyFat > 17 && bodyFat <= 24) { } else if (bodyFat > 17 && bodyFat <= 24) {
textResult = TranslationBase.of(context).fitness; textResult = TranslationBase.of(context).fitness;
} else if (bodyFat > 24 && bodyFat <= 45) { } else if (bodyFat > 24 && bodyFat <= 45) {
textResult = TranslationBase.of(context).obeseBodyFat; textResult = TranslationBase.of(context).underObese;
} else if (bodyFat > 45) { } else if (bodyFat > 45) {
textResult = TranslationBase.of(context).more; textResult = TranslationBase.of(context).crossedLimits;
} else if (bodyFat <= 5) { } else if (bodyFat <= 5) {
textResult = TranslationBase.of(context).less; textResult = TranslationBase.of(context).lowLimits;
} }
} }
} }
@ -222,8 +222,16 @@ class _BodyFatState extends State<BodyFat> {
isShowDecPage: false, isShowDecPage: false,
showNewAppBarTitle: true, showNewAppBarTitle: true,
showNewAppBar: true, showNewAppBar: true,
showHomeAppBarIcon: true,
appBarTitle: TranslationBase.of(context).bodyFatTitle, appBarTitle: TranslationBase.of(context).bodyFatTitle,
appBarIcons: [
Padding(
padding: const EdgeInsets.symmetric(horizontal: 10.0, vertical: 7.0),
child: Icon(
Icons.info_outline,
color: Colors.white,
),
)
],
body: Column( body: Column(
children: [ children: [
Expanded( Expanded(
@ -449,7 +457,7 @@ class _BodyFatState extends State<BodyFat> {
onTap: () { onTap: () {
setState(() { setState(() {
calculateBodyFat(); calculateBodyFat();
showTextResult(); showTextResult(context);
{ {
Navigator.push( Navigator.push(

@ -2,7 +2,8 @@ import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -84,8 +85,16 @@ class _CalorieCalculatorState extends State<CalorieCalculator> {
isShowDecPage: false, isShowDecPage: false,
showNewAppBar: true, showNewAppBar: true,
showNewAppBarTitle: true, showNewAppBarTitle: true,
showHomeAppBarIcon: true,
appBarTitle: "${TranslationBase.of(context).calories} ${TranslationBase.of(context).calcHealth}", appBarTitle: "${TranslationBase.of(context).calories} ${TranslationBase.of(context).calcHealth}",
appBarIcons: [
Padding(
padding: const EdgeInsets.symmetric(horizontal: 10.0, vertical: 7.0),
child: Icon(
Icons.info_outline,
color: Colors.black,
),
)
],
body: Column( body: Column(
children: [ children: [
Expanded( Expanded(
@ -252,6 +261,7 @@ class _CalorieCalculatorState extends State<CalorieCalculator> {
SizedBox( SizedBox(
height: 12.0, height: 12.0,
), ),
InkWell( InkWell(
onTap: () { onTap: () {
// dropdownKey.currentState; // dropdownKey.currentState;
@ -295,15 +305,14 @@ class _CalorieCalculatorState extends State<CalorieCalculator> {
}); });
}, },
items: <String>[ items: <String>[
TranslationBase.of(context).inactiveAct, TranslationBase.of(context).almostInactive,
TranslationBase.of(context).light, TranslationBase.of(context).lightActive,
TranslationBase.of(context).very, TranslationBase.of(context).lightActive1,
TranslationBase.of(context).superAct, TranslationBase.of(context).superActive,
].map<DropdownMenuItem<String>>((String value) { ].map<DropdownMenuItem<String>>((String value) {
return DropdownMenuItem<String>( return DropdownMenuItem<String>(
value: value, value: value,
child: Text(value, child: Text(value),
style: TextStyle(fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins', fontSize: 11, letterSpacing: -0.44, fontWeight: FontWeight.w600)),
); );
}).toList(), }).toList(),
), ),
@ -328,9 +337,10 @@ class _CalorieCalculatorState extends State<CalorieCalculator> {
Container( Container(
margin: EdgeInsets.symmetric(horizontal: 16.0, vertical: 16.0), margin: EdgeInsets.symmetric(horizontal: 16.0, vertical: 16.0),
color: Colors.white, color: Colors.white,
child: DefaultButton( child: SecondaryButton(
TranslationBase.of(context).calculate, label: TranslationBase.of(context).calculate,
() { color: CustomColors.accentColor,
onTap: () {
setState(() { setState(() {
calculateCalories(); calculateCalories();
print(calories); print(calories);

@ -5,7 +5,9 @@ import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -35,7 +37,7 @@ class CalorieResultPage extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( Text(
TranslationBase.of(context).calories, TranslationBase.of(context).calories,
style: TextStyle( style: TextStyle(
fontSize: 19, fontSize: 19,
letterSpacing: -1.34, letterSpacing: -1.34,
@ -73,14 +75,18 @@ class CalorieResultPage extends StatelessWidget {
], ],
), ),
progressColor: CustomColors.accentColor, progressColor: CustomColors.accentColor,
backgroundColor: CustomColors.darkGreyColor, backgroundColor: Colors.white,
), ),
), ),
mHeight(20), mHeight(20),
Text( Text(
TranslationBase.of(context).resultCalories.replaceAll("(#)", calorie.toStringAsFixed(1)), TranslationBase.of(context).dailyIntake+' ${calorie.toStringAsFixed(1)} '+TranslationBase.of(context).calories,
// 'Daily intake is ${calorie.toStringAsFixed(1)} calories', style: TextStyle(
style: TextStyle(fontSize: 14, letterSpacing: -0.56, fontWeight: FontWeight.w600, color: CustomColors.textColor), fontSize: 14,
letterSpacing: -0.56,
fontWeight: FontWeight.w600,
color: CustomColors.textColor
),
), ),
], ],
).withBorderedContainer, ).withBorderedContainer,
@ -89,13 +95,15 @@ class CalorieResultPage extends StatelessWidget {
Container( Container(
margin: EdgeInsets.symmetric(horizontal: 16.0, vertical: 16.0), margin: EdgeInsets.symmetric(horizontal: 16.0, vertical: 16.0),
color: Colors.white, color: Colors.white,
child: DefaultButton( child: SecondaryButton(
TranslationBase.of(context).viewDocList, label: TranslationBase.of(context).viewDocList,
() { color: CustomColors.accentColor,
onTap: () {
getDoctorsList(context); getDoctorsList(context);
}, },
), ),
), ),
], ],
), ),
); );

@ -1,6 +1,8 @@
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
@ -44,103 +46,114 @@ class _DeliveryDueState extends State<DeliveryDue> {
showNewAppBarTitle: true, showNewAppBarTitle: true,
isShowDecPage: false, isShowDecPage: false,
appBarTitle: TranslationBase.of(context).pregnancyTitle, appBarTitle: TranslationBase.of(context).pregnancyTitle,
body: Padding( body: Column(
padding: EdgeInsets.symmetric(horizontal: 35.0, vertical: 20.0), children: [
child: SingleChildScrollView( Expanded(
child: Container( child: SingleChildScrollView(
child: Column( child: Container(
children: [ padding: EdgeInsets.symmetric(horizontal: 21.0, vertical: 21.0),
Texts( child: Column(
TranslationBase.of(context).pregnancyDesc,
),
Divider(
//height: 2,
thickness: 2,
),
Column(
children: [ children: [
Texts( Text(
TranslationBase.of(context).pregnancyDateLabel, TranslationBase.of(context).pregnancyDesc,
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
),
), ),
InkWell( Divider(
onTap: () { //height: 2,
DatePicker.showDatePicker( thickness: 1,
context, ),
showTitleActions: true, Column(
minTime: DateTime(DateTime.now().year - 1, 1, 1), children: [
maxTime: DateTime.now(), Text(
onConfirm: (date) { TranslationBase.of(context).pregnancyDateLabel,
print('confirm $date'); style: TextStyle(
setState(() { fontSize: 14,
bloodSugarDate = date; fontWeight: FontWeight.w600,
dateFrom = date.add(Duration(days: 10)); ),
),
InkWell(
onTap: () {
DatePicker.showDatePicker(
context,
showTitleActions: true,
minTime: DateTime(DateTime.now().year - 1, 1, 1),
maxTime: DateTime.now(),
onConfirm: (date) {
print('confirm $date');
setState(() {
bloodSugarDate = date;
dateFrom = date.add(Duration(days: 10));
dateTo = date.add(Duration(days: 20)); dateTo = date.add(Duration(days: 20));
conceivedDate = date.add(Duration(days: 14)); conceivedDate = date.add(Duration(days: 14));
deliveryDue = date.add(Duration(days: 280)); deliveryDue = date.add(Duration(days: 280));
firstTrimester = date.add(Duration(days: 85)); firstTrimester = date.add(Duration(days: 85));
secondTrimester = date.add(Duration(days: 190)); secondTrimester = date.add(Duration(days: 190));
thirdTrimester = date.add(Duration(days: 280)); thirdTrimester = date.add(Duration(days: 280));
}); });
},
currentTime: DateTime.now(),
);
}, },
currentTime: DateTime.now(), child: Container(
); padding: EdgeInsets.all(12),
}, margin: EdgeInsets.only(top: 15.0),
child: Container( width: double.infinity,
padding: EdgeInsets.all(12), height: 65,
margin: EdgeInsets.only(top: 15.0), decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white),
width: double.infinity, child: Row(
height: 65, mainAxisAlignment: MainAxisAlignment.spaceBetween,
decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [ children: [
Icon(Icons.date_range), Row(
Texts(TranslationBase.of(context).date), children: [
Icon(Icons.date_range),
Texts(TranslationBase.of(context).date),
],
),
Texts(getDate()),
], ],
), ),
Texts(getDate()), ),
],
), ),
), ],
), ),
], ],
), ),
SizedBox( ),
height: 280.0, ),
), ),
Container( Container(
height: 50.0, margin: EdgeInsets.symmetric(horizontal: 16.0, vertical: 16.0),
width: 350.0, color: Colors.white,
child: DefaultButton( child: SecondaryButton(
TranslationBase.of(context).calculate, label: TranslationBase.of(context).calculate,
() { color: CustomColors.accentColor,
setState(() { onTap: () {
{ setState(() {
Navigator.push( {
context, Navigator.push(
FadePage( context,
page: DeliveryDueResult( FadePage(
conceivedDate: conceivedDate, page: DeliveryDueResult(
dateFrom: dateFrom, conceivedDate: conceivedDate,
dateTo: dateTo, dateFrom: dateFrom,
deliveryDue: deliveryDue, dateTo: dateTo,
firstTrimester: firstTrimester, deliveryDue: deliveryDue,
secondTrimester: secondTrimester, firstTrimester: firstTrimester,
thirdTrimester: thirdTrimester, secondTrimester: secondTrimester,
)), thirdTrimester: thirdTrimester,
); )),
} );
}); }
}, });
), },
),
],
), ),
), ),
), ],
), ),
); );
} }

@ -1,9 +1,12 @@
import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/health-calculator/bariatrics-service.dart'; import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/health-calculator/bariatrics-service.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/SearchResults.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/SearchResults.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
@ -29,78 +32,102 @@ class DeliveryDueResult extends StatelessWidget {
showNewAppBarTitle: true, showNewAppBarTitle: true,
isShowDecPage: false, isShowDecPage: false,
appBarTitle: TranslationBase.of(context).pregnancyTitle, appBarTitle: TranslationBase.of(context).pregnancyTitle,
body: Padding( body: Column(
padding: EdgeInsets.symmetric(horizontal: 30.0, vertical: 12.0), children: [
child: SingleChildScrollView( Expanded(
child: Container( child: SingleChildScrollView(
height: 750.0, child: Container(
child: Column( padding: EdgeInsets.symmetric(horizontal: 21.0, vertical: 21.0),
crossAxisAlignment: CrossAxisAlignment.start, child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly, crossAxisAlignment: CrossAxisAlignment.start,
children: [ mainAxisAlignment: MainAxisAlignment.spaceEvenly,
Texts( children: [
TranslationBase.of(context).ovulationPeriod, Text(
fontWeight: FontWeight.w400, TranslationBase.of(context).pregnancyTitle,
), style: TextStyle(
Texts( fontSize: 19,
TranslationBase.of(context).from, letterSpacing: -1.14,
fontWeight: FontWeight.w400, fontWeight: FontWeight.w600,
), ),
Texts(DateFormat.yMMMEd().format(dateFrom), fontWeight: FontWeight.w800, fontSize: 21.0, color: Color(0xffC5272D)), ),
Texts( Text(
TranslationBase.of(context).to, TranslationBase.of(context).ovulationPeriod,
fontWeight: FontWeight.w400, style: TextStyle(
), fontSize: 14,
Texts(DateFormat.yMMMEd().format(dateTo), fontWeight: FontWeight.w800, fontSize: 21.0, color: Color(0xffC5272D)), letterSpacing: -0.56,
Texts( fontWeight: FontWeight.w600,
TranslationBase.of(context).conceive, color: CustomColors.textColor,
fontWeight: FontWeight.w400, ),
), ),
Texts( mHeight(20),
DateFormat.yMMMEd().format(conceivedDate), showItem(TranslationBase.of(context).from, DateFormat.yMMMEd().format(dateFrom), titleColor: CustomColors.accentColor),
fontWeight: FontWeight.w800, mHeight(12),
fontSize: 21.0, showItem(TranslationBase.of(context).to, DateFormat.yMMMEd().format(dateTo), titleColor: CustomColors.accentColor),
), mHeight(12),
Texts( mDivider(CustomColors.devider),
TranslationBase.of(context).firstTri, mHeight(12),
fontWeight: FontWeight.w400, showItem(TranslationBase.of(context).conceive, DateFormat.yMMMEd().format(conceivedDate)),
), mHeight(12),
Texts( mDivider(CustomColors.devider),
DateFormat.yMMMEd().format(firstTrimester), mHeight(12),
fontWeight: FontWeight.w800, showItem(TranslationBase.of(context).firstTri, DateFormat.yMMMEd().format(firstTrimester)),
fontSize: 21.0, mHeight(12),
), mDivider(CustomColors.devider),
Texts( mHeight(12),
TranslationBase.of(context).secondTri, showItem(TranslationBase.of(context).secondTri, DateFormat.yMMMEd().format(secondTrimester)),
fontWeight: FontWeight.w400, mHeight(12),
), mDivider(CustomColors.devider),
Texts( mHeight(12),
DateFormat.yMMMEd().format(secondTrimester), showItem(TranslationBase.of(context).thirdTri, DateFormat.yMMMEd().format(thirdTrimester)),
fontWeight: FontWeight.w800, mHeight(12),
fontSize: 21.0, mDivider(CustomColors.devider),
), mHeight(12),
Texts( ],
TranslationBase.of(context).thirdTri, ).withBorderedContainer,
fontWeight: FontWeight.w400, ),
),
Texts(
DateFormat.yMMMEd().format(thirdTrimester),
fontWeight: FontWeight.w800,
fontSize: 21.0,
),
Container(
width: 350,
child: DefaultButton(
TranslationBase.of(context).seeDoctorsList,
() {
getDoctorsList(context);
},
),
),
],
), ),
), ),
), Container(
margin: EdgeInsets.symmetric(horizontal: 16.0, vertical: 16.0),
color: Colors.white,
child: SecondaryButton(
label: TranslationBase.of(context).seeDoctorsList,
color: CustomColors.accentColor,
onTap: () {
getDoctorsList(context);
},
),
),
],
),
);
}
Widget showItem(String title, String value, {Color titleColor}) {
return Container(
width: double.infinity,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
title,
style: TextStyle(
fontSize: 14,
letterSpacing: -0.56,
color: titleColor ?? Colors.black,
fontWeight: FontWeight.w500,
// fontWeight: FontWeight.w600,
),
),
Text(
value,
style: TextStyle(
fontSize: 18,
letterSpacing: -1.08,
fontWeight: FontWeight.w600,
),
),
],
), ),
); );
} }
@ -145,20 +172,11 @@ class DeliveryDueResult extends StatelessWidget {
if (doctorByHospital.length != 0) { if (doctorByHospital.length != 0) {
_patientDoctorAppointmentListHospital[_patientDoctorAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList.add(element); _patientDoctorAppointmentListHospital[_patientDoctorAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList.add(element);
} else { } else {
_patientDoctorAppointmentListHospital _patientDoctorAppointmentListHospital.add(PatientDoctorAppointmentList(filterName: element.projectName, distanceInKMs: "0", patientDoctorAppointment: element));
.add(PatientDoctorAppointmentList(filterName: element.projectName, distanceInKMs: "0", patientDoctorAppointment: element));
} }
}); });
Navigator.push( Navigator.push(context, FadePage(page: SearchResults(isLiveCareAppointment: false, doctorsList: doctorsList, patientDoctorAppointmentListHospital: _patientDoctorAppointmentListHospital)));
context,
FadePage(
page: SearchResults(
isLiveCareAppointment: false,
doctorsList: doctorsList,
patientDoctorAppointmentListHospital:
_patientDoctorAppointmentListHospital)));
} }
} }
}).catchError((err) { }).catchError((err) {
@ -167,3 +185,19 @@ class DeliveryDueResult extends StatelessWidget {
}); });
} }
} }
extension BorderedContainer on Widget {
Widget get withBorderedContainer => Container(
padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15),
color: Colors.white,
border: Border.all(
color: Color(0xffefefef),
width: 1,
),
),
child: this,
);
}

@ -1,13 +1,11 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:provider/provider.dart';
import 'ideal_body_result_page.dart'; import 'ideal_body_result_page.dart';
@ -36,7 +34,7 @@ class _IdealBodyState extends State<IdealBody> {
double overWeightBy; double overWeightBy;
int weight = 0; int weight = 0;
double idealWeight = 0; double idealWeight = 0;
String dropdownValue = TranslationBase.of(AppGlobal.context).bodyFrameMedium; String dropdownValue = null;
double calories = 0; double calories = 0;
String textResult = ''; String textResult = '';
double maxIdealWeight; double maxIdealWeight;
@ -54,15 +52,17 @@ class _IdealBodyState extends State<IdealBody> {
List<PopupMenuItem> _heightPopupList = List(); List<PopupMenuItem> _heightPopupList = List();
List<PopupMenuItem> _weightPopupList = List(); List<PopupMenuItem> _weightPopupList = List();
void calculateIdealWeight() { void calculateIdealWeight() {
heightInches = int.parse(_heightController.text) * .39370078740157477; heightInches = int.parse(_heightController.text) * .39370078740157477;
heightFeet = heightInches / 12; heightFeet = heightInches / 12;
idealWeight = (50 + 2.3 * (heightInches - 60)); idealWeight = (50 + 2.3 * (heightInches - 60));
if (dropdownValue == TranslationBase.of(context).bodyFrameSmall) { if (dropdownValue == TranslationBase.of(context).smallFinger) {
idealWeight = idealWeight - 10; idealWeight = idealWeight - 10;
} else if (dropdownValue == TranslationBase.of(context).bodyFrameMedium) { } else if (dropdownValue == TranslationBase.of(context).mediumFinger) {
idealWeight = idealWeight; idealWeight = idealWeight;
} else if (dropdownValue == TranslationBase.of(context).bodyFrameLarge) { } else if (dropdownValue == TranslationBase.of(context).largeFinger) {
idealWeight = idealWeight + 10; idealWeight = idealWeight + 10;
} }
@ -75,7 +75,8 @@ class _IdealBodyState extends State<IdealBody> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); if(dropdownValue==null)
dropdownValue=TranslationBase.of(context).mediumFinger;
_weightPopupList = <PopupMenuItem>[PopupMenuItem(child: Text(TranslationBase.of(context).kg), value: true), PopupMenuItem(child: Text(TranslationBase.of(context).lb), value: false)]; _weightPopupList = <PopupMenuItem>[PopupMenuItem(child: Text(TranslationBase.of(context).kg), value: true), PopupMenuItem(child: Text(TranslationBase.of(context).lb), value: false)];
_heightPopupList = <PopupMenuItem>[PopupMenuItem(child: Text(TranslationBase.of(context).cm), value: true), PopupMenuItem(child: Text(TranslationBase.of(context).ft), value: false)]; _heightPopupList = <PopupMenuItem>[PopupMenuItem(child: Text(TranslationBase.of(context).cm), value: true), PopupMenuItem(child: Text(TranslationBase.of(context).ft), value: false)];
@ -85,7 +86,16 @@ class _IdealBodyState extends State<IdealBody> {
showNewAppBarTitle: true, showNewAppBarTitle: true,
showNewAppBar: true, showNewAppBar: true,
appBarTitle: TranslationBase.of(context).idealBody, appBarTitle: TranslationBase.of(context).idealBody,
showHomeAppBarIcon: true, showHomeAppBarIcon: false,
appBarIcons: [
Padding(
padding: const EdgeInsets.symmetric(horizontal: 10.0, vertical: 7.0),
child: Icon(
Icons.info_outline,
color: Colors.white,
),
)
],
body: Column( body: Column(
children: [ children: [
Expanded( Expanded(
@ -95,7 +105,7 @@ class _IdealBodyState extends State<IdealBody> {
child: Column( child: Column(
children: [ children: [
Text( Text(
TranslationBase.of(context).idealWeightDesc, TranslationBase.of(context).idealBodyWeight,
style: TextStyle( style: TextStyle(
fontSize: 14, fontSize: 14,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
@ -178,7 +188,7 @@ class _IdealBodyState extends State<IdealBody> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( Text(
TranslationBase.of(context).bodyFrame, TranslationBase.of(context).bodyFrameSize,
style: TextStyle( style: TextStyle(
fontSize: 11, fontSize: 11,
letterSpacing: -0.44, letterSpacing: -0.44,
@ -205,14 +215,13 @@ class _IdealBodyState extends State<IdealBody> {
}); });
}, },
items: <String>[ items: <String>[
TranslationBase.of(context).bodyFrameSmall, TranslationBase.of(context).smallFinger,
TranslationBase.of(context).bodyFrameMedium, TranslationBase.of(context).mediumFinger,
TranslationBase.of(context).bodyFrameLarge, TranslationBase.of(context).largeFinger,
].map<DropdownMenuItem<String>>((String value) { ].map<DropdownMenuItem<String>>((String value) {
return DropdownMenuItem<String>( return DropdownMenuItem<String>(
value: value, value: value,
child: Text(value, child: Text(value),
style: TextStyle(fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins', fontSize: 11, letterSpacing: -0.44, fontWeight: FontWeight.w600)),
); );
}).toList(), }).toList(),
), ),
@ -500,3 +509,5 @@ class CommonDropDownView extends StatelessWidget {
); );
} }
} }

@ -40,7 +40,7 @@ class IdealBodyResult extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( Text(
'Ideal weight range is', TranslationBase.of(context).idealWeightRange,
style: TextStyle( style: TextStyle(
fontSize: 19, fontSize: 19,
letterSpacing: -1.34, letterSpacing: -1.34,
@ -60,7 +60,7 @@ class IdealBodyResult extends StatelessWidget {
Padding( Padding(
padding: EdgeInsets.only(top: 8.0, left: 4.0), padding: EdgeInsets.only(top: 8.0, left: 4.0),
child: Text( child: Text(
'Kg', " "+TranslationBase.of(context).kg+" ",
style: TextStyle(color: Colors.red), style: TextStyle(color: Colors.red),
), ),
), ),
@ -80,7 +80,7 @@ class IdealBodyResult extends StatelessWidget {
Padding( Padding(
padding: EdgeInsets.only(top: 8.0, left: 4.0), padding: EdgeInsets.only(top: 8.0, left: 4.0),
child: Text( child: Text(
'Kg', " "+TranslationBase.of(context).kg+" ",
style: TextStyle(color: Colors.red), style: TextStyle(color: Colors.red),
), ),
), ),
@ -93,7 +93,7 @@ class IdealBodyResult extends StatelessWidget {
? Column( ? Column(
children: [ children: [
Texts( Texts(
'Congratulations! The current weight is perfect and considered healthy', TranslationBase.of(context).currentWeightPerfect,
fontSize: 20.0, fontSize: 20.0,
), ),
], ],
@ -101,9 +101,9 @@ class IdealBodyResult extends StatelessWidget {
: overWeightBy > 10 && overWeightBy < 17 : overWeightBy > 10 && overWeightBy < 17
? Column( ? Column(
children: [ children: [
Texts('This means that the weight is a little bit more than ideal weight by'), Texts(TranslationBase.of(context).littleBitWeightMore),
Texts(overWeightBy.toStringAsFixed(1)), Texts(overWeightBy.toStringAsFixed(1)),
Texts('May wish to consult with the doctor for medical help. Click to view our list of Doctors'), Texts(TranslationBase.of(context).consultWithDoctor),
], ],
) )
: overWeightBy >= 18 : overWeightBy >= 18
@ -112,7 +112,7 @@ class IdealBodyResult extends StatelessWidget {
child: Column( child: Column(
children: [ children: [
Texts( Texts(
'Means that you suffer from excessive obesity by', TranslationBase.of(context).excessiveObesity,
), ),
SizedBox( SizedBox(
height: 12.0, height: 12.0,
@ -128,7 +128,7 @@ class IdealBodyResult extends StatelessWidget {
SizedBox( SizedBox(
height: 12.0, height: 12.0,
), ),
Texts('May wish to consult with the doctor for medical help. Click to view our list of\n Doctors'), Texts(TranslationBase.of(context).mayWish),
], ],
), ),
) )
@ -139,7 +139,7 @@ class IdealBodyResult extends StatelessWidget {
Padding( Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Texts( child: Texts(
'Under Weight', TranslationBase.of(context).underWeight,
fontSize: 18.0, fontSize: 18.0,
), ),
), ),
@ -161,7 +161,7 @@ class IdealBodyResult extends StatelessWidget {
child: Column( child: Column(
children: [ children: [
Text( Text(
'under wheight', TranslationBase.of(context).underWeight,
style: TextStyle( style: TextStyle(
fontSize: 17, fontSize: 17,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
@ -182,7 +182,7 @@ class IdealBodyResult extends StatelessWidget {
SizedBox( SizedBox(
height: 12.0, height: 12.0,
), ),
Texts('May wish to consult with the doctor for medical help. Click to view our list of Doctors'), Texts(TranslationBase.of(context).mayWish),
], ],
), ),
), ),

@ -1,6 +1,8 @@
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
@ -20,8 +22,9 @@ class _OvulationPeriodState extends State<OvulationPeriod> {
DateTime bloodSugarDate = DateTime.now(); DateTime bloodSugarDate = DateTime.now();
DateTime timeSugarDate = DateTime.now(); DateTime timeSugarDate = DateTime.now();
DateTime selectedDateTime = DateTime.now(); DateTime selectedDateTime = DateTime.now();
int cycleLength = 0;
int lutealPhaseLength = 0; // int cycleLength = 0;
// int lutealPhaseLength = 0;
String selectedDate; String selectedDate;
var dateFrom = DateTime.now(); var dateFrom = DateTime.now();
var babyAgeWeeks; var babyAgeWeeks;
@ -33,6 +36,9 @@ class _OvulationPeriodState extends State<OvulationPeriod> {
var newFormat = DateFormat("yy-MM-dd"); var newFormat = DateFormat("yy-MM-dd");
String updatedDt; String updatedDt;
TextEditingController cycleLengthController = new TextEditingController();
TextEditingController lutelLengthController = new TextEditingController();
String getTime() { String getTime() {
return " ${timeSugarDate.hour}:${timeSugarDate.minute}"; return " ${timeSugarDate.hour}:${timeSugarDate.minute}";
} }
@ -64,286 +70,176 @@ class _OvulationPeriodState extends State<OvulationPeriod> {
showNewAppBarTitle: true, showNewAppBarTitle: true,
isShowDecPage: false, isShowDecPage: false,
appBarTitle: TranslationBase.of(context).ovulation, appBarTitle: TranslationBase.of(context).ovulation,
body: Padding( body: Column(
padding: EdgeInsets.symmetric(horizontal: 25.0, vertical: 15.0), children: [
child: SingleChildScrollView( Expanded(
child: Container( child: SingleChildScrollView(
height: 700.0, child: Container(
child: Column( padding: EdgeInsets.all(21),
crossAxisAlignment: CrossAxisAlignment.start, child: Column(
children: [ crossAxisAlignment: CrossAxisAlignment.start,
Texts(TranslationBase.of(context).ovulationDesc),
SizedBox(
height: 12.0,
),
Divider(
//height: 2,
thickness: 2,
),
SizedBox(
height: 12.0,
),
InkWell(
onTap: () {
DatePicker.showDatePicker(
context,
showTitleActions: true,
minTime: DateTime(DateTime.now().year - 1, 1, 1),
maxTime: DateTime.now(),
onConfirm: (date) {
print('confirm $date');
setState(() {
selectedDateTime = date;
});
},
currentTime: DateTime.now(),
);
},
child: Container(
padding: EdgeInsets.all(12),
width: double.infinity,
height: 65,
decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Texts(TranslationBase.of(context).date),
Texts(getDate()),
],
),
),
),
SizedBox(
height: 5.0,
),
Texts(
TranslationBase.of(context).cycleLabel,
fontWeight: FontWeight.w400,
),
SizedBox(
height: 5.0,
),
Row(
children: [ children: [
Container( Text(
width: 340.0, TranslationBase.of(context).ovulationDesc,
height: 60.0, style: TextStyle(
decoration: BoxDecoration( fontSize: 14,
color: Colors.white, letterSpacing: -0.54,
color: Colors.black,
fontWeight: FontWeight.w600,
), ),
child: Row( ),
children: [ SizedBox(
Padding( height: 12.0,
padding: EdgeInsets.symmetric(vertical: 10.0, horizontal: 8.0), ),
child: Center( InkWell(
child: Container( onTap: () {
width: 60.0, DatePicker.showDatePicker(
foregroundDecoration: BoxDecoration( context,
borderRadius: BorderRadius.circular(5.0), showTitleActions: true,
border: Border.all( minTime: DateTime(DateTime.now().year - 1, 1, 1),
color: Colors.blueGrey, maxTime: DateTime.now(),
width: 2.0, onConfirm: (date) {
), print('confirm $date');
), setState(() {
child: Row( selectedDateTime = date;
children: <Widget>[ });
Expanded( },
child: Center( currentTime: DateTime.now(),
child: Text(cycleLength.toString()), );
), },
), child: Container(
Container( padding: EdgeInsets.all(12),
height: 38.0, width: double.infinity,
child: Column( height: 65,
crossAxisAlignment: CrossAxisAlignment.center, decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white),
mainAxisAlignment: MainAxisAlignment.center, child: Row(
children: <Widget>[ mainAxisAlignment: MainAxisAlignment.spaceBetween,
Container( children: [
decoration: BoxDecoration( Texts(TranslationBase.of(context).date),
border: Border( Texts(getDate()),
bottom: BorderSide( ],
width: 0.5, ),
),
),
),
child: InkWell(
child: Icon(
Icons.arrow_drop_up,
size: 18.0,
),
onTap: () {
setState(() {
if (cycleLength < 45) cycleLength++;
});
},
),
),
InkWell(
child: Icon(
Icons.arrow_drop_down,
size: 18.0,
),
onTap: () {
setState(() {
if (cycleLength > 0) cycleLength--;
});
},
),
],
),
),
],
),
),
),
),
Expanded(
child: Slider(
value: cycleLength.toDouble(),
min: 0,
max: 45,
onChanged: (double newValue) {
setState(() {
cycleLength = newValue.round();
});
},
activeColor: Color(0xffC5272D),
inactiveColor: Color(0xffF3C5C6),
),
),
],
), ),
), ),
SizedBox(
height: 12.0,
),
inputWidget(TranslationBase.of(context).cycleLabel, "0", cycleLengthController),
SizedBox(
height: 12.0,
),
inputWidget(TranslationBase.of(context).lutealLabel, "0", lutelLengthController),
], ],
), ),
Texts( ),
TranslationBase.of(context).lutealLabel, ),
fontWeight: FontWeight.w400, ),
), Container(
SizedBox( margin: EdgeInsets.symmetric(horizontal: 16.0, vertical: 16.0),
height: 5.0, color: Colors.white,
), child: SecondaryButton(
Row( label: TranslationBase.of(context).calculate,
children: [ color: CustomColors.accentColor,
Container( onTap: () {
width: 340.0, calculateBabyInformation();
height: 60.0, Navigator.push(
decoration: BoxDecoration( context,
color: Colors.white, FadePage(
page: OvulationResult(
conceivedDate: conceivedDate,
dateFrom: dateFrom,
dateTo: dateTo,
deliveryDue: deliveryDue,
babyAge: babyAgeWeeks,
babyAgeDays: babyAgeDays,
),
),
);
},
),
),
],
),
);
}
Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller, {String prefix, bool isEnable = true, bool hasSelection = false}) {
return Container(
padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15),
color: Colors.white,
border: Border.all(
color: Color(0xffefefef),
width: 1,
),
),
child: InkWell(
onTap: hasSelection ? () {} : null,
child: Row(
children: [
Expanded(
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
_labelText,
style: TextStyle(
fontSize: 11,
fontWeight: FontWeight.w600,
color: Color(0xff2B353E),
letterSpacing: -0.44,
),
),
TextField(
enabled: isEnable,
scrollPadding: EdgeInsets.zero,
keyboardType: TextInputType.number,
controller: _controller,
onChanged: (value) => {},
style: TextStyle(
fontSize: 14,
height: 21 / 14,
fontWeight: FontWeight.w400,
color: Color(0xff2B353E),
letterSpacing: -0.44,
),
decoration: InputDecoration(
isDense: true,
hintText: _hintText,
hintStyle: TextStyle(
fontSize: 14,
height: 21 / 14,
fontWeight: FontWeight.w400,
color: Color(0xff575757),
letterSpacing: -0.56,
), ),
child: Row( prefixIconConstraints: BoxConstraints(minWidth: 50),
children: [ prefixIcon: prefix == null
Padding( ? null
padding: EdgeInsets.symmetric(vertical: 10.0, horizontal: 8.0), : Text(
child: Center( "+" + prefix,
child: Container( style: TextStyle(
width: 60.0, fontSize: 14,
foregroundDecoration: BoxDecoration( height: 21 / 14,
borderRadius: BorderRadius.circular(5.0), fontWeight: FontWeight.w500,
border: Border.all( color: Color(0xff2E303A),
color: Colors.blueGrey, letterSpacing: -0.56,
width: 2.0,
),
),
child: Row(
children: <Widget>[
Expanded(
child: Center(
child: Text(lutealPhaseLength.toString()),
),
),
Container(
height: 38.0,
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Container(
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
width: 0.5,
),
),
),
child: InkWell(
child: Icon(
Icons.arrow_drop_up,
size: 18.0,
),
onTap: () {
setState(() {
if (lutealPhaseLength < 15) lutealPhaseLength++;
});
},
),
),
InkWell(
child: Icon(
Icons.arrow_drop_down,
size: 18.0,
),
onTap: () {
setState(() {
if (lutealPhaseLength > 0) lutealPhaseLength--;
});
},
),
],
),
),
],
),
), ),
), ),
), contentPadding: EdgeInsets.zero,
Expanded( border: InputBorder.none,
child: Slider( focusedBorder: InputBorder.none,
value: lutealPhaseLength.toDouble(), enabledBorder: InputBorder.none,
min: 0,
max: 15,
onChanged: (double newValue) {
setState(() {
lutealPhaseLength = newValue.round();
});
},
activeColor: Color(0xffC5272D),
inactiveColor: Color(0xffF3C5C6),
),
),
],
),
), ),
],
),
SizedBox(
height: 220.0,
),
Container(
height: 50.0,
width: 350.0,
child: DefaultButton(
TranslationBase.of(context).calculate,
() {
calculateBabyInformation();
Navigator.push(
context,
FadePage(
page: OvulationResult(
conceivedDate: conceivedDate,
dateFrom: dateFrom,
dateTo: dateTo,
deliveryDue: deliveryDue,
babyAge: babyAgeWeeks,
babyAgeDays: babyAgeDays,
)),
);
},
), ),
), ],
], ),
), ),
), if (hasSelection) Icon(Icons.keyboard_arrow_down_outlined),
],
), ),
), ),
); );

@ -1,9 +1,12 @@
import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/health-calculator/bariatrics-service.dart'; import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/health-calculator/bariatrics-service.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/SearchResults.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/SearchResults.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
@ -26,6 +29,7 @@ class OvulationResult extends StatelessWidget {
this.babyAge, this.babyAge,
this.babyAgeDays, this.babyAgeDays,
}); });
//var newFormat = DateFormat("yy-MM-dd"); //var newFormat = DateFormat("yy-MM-dd");
@override @override
@ -35,81 +39,105 @@ class OvulationResult extends StatelessWidget {
showNewAppBarTitle: true, showNewAppBarTitle: true,
isShowDecPage: false, isShowDecPage: false,
appBarTitle: TranslationBase.of(context).ovulation, appBarTitle: TranslationBase.of(context).ovulation,
body: Padding( body: Column(
padding: EdgeInsets.symmetric(horizontal: 30.0, vertical: 15.0), children: [
child: SingleChildScrollView( Expanded(
child: Container( child: SingleChildScrollView(
height: 750.0, child: Padding(
child: Column( padding: const EdgeInsets.all(21),
crossAxisAlignment: CrossAxisAlignment.start, child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Texts( Text(
'The next ovulation period is estimated to be:', TranslationBase.of(context).ovulation,
fontWeight: FontWeight.w400, style: TextStyle(
), fontSize: 19,
Texts( letterSpacing: -1.14,
'From:', fontWeight: FontWeight.w600,
fontWeight: FontWeight.w400, ),
), ),
Texts( mHeight(20),
DateFormat.yMMMEd().format(dateFrom), Text(
fontWeight: FontWeight.w800, TranslationBase.of(context).ovulationPeriod,
fontSize: 21.0, style: TextStyle(
), fontSize: 14,
Texts( letterSpacing: -0.56,
'To:', fontWeight: FontWeight.w600,
fontWeight: FontWeight.w400, color: CustomColors.textColor,
), ),
Texts( ),
DateFormat.yMMMEd().format(dateTo), mHeight(20),
fontWeight: FontWeight.w800, showItem(TranslationBase.of(context).from, DateFormat.yMMMEd().format(dateFrom), titleColor: CustomColors.accentColor),
fontSize: 21.0, mHeight(12),
), showItem(TranslationBase.of(context).to, DateFormat.yMMMEd().format(dateTo), titleColor: CustomColors.accentColor),
Texts( mHeight(12),
'Useful Information:', mDivider(CustomColors.devider),
color: Color(0xffC5272D), mHeight(12),
), Text(
Texts( TranslationBase.of(context).useFullInfo,
'You have conceived on:', style: TextStyle(
fontWeight: FontWeight.w400, fontSize: 14,
), letterSpacing: -0.56,
Texts( color: CustomColors.accentColor,
DateFormat.yMMMEd().format(conceivedDate), fontWeight: FontWeight.w500,
fontWeight: FontWeight.w800, ),
fontSize: 21.0, ),
), mHeight(12),
Texts( showItem(TranslationBase.of(context).conceive, DateFormat.yMMMEd().format(conceivedDate)),
'The baby\'s age right now:', mHeight(12),
fontWeight: FontWeight.w400, mDivider(CustomColors.devider),
), mHeight(12),
Texts( showItem(TranslationBase.of(context).babyAge, babyAge <= 0 ? TranslationBase.of(context).babyAgeAvail : babyAge.toString() + TranslationBase.of(context).week),
babyAge <= 0 ? "baby age is not available" : babyAge.toString() + " Weeks",
fontWeight: FontWeight.w800, mHeight(12),
fontSize: 21.0, mDivider(CustomColors.devider),
), mHeight(12), showItem(TranslationBase.of(context).deliveryDue, DateFormat.yMMMEd().format(deliveryDue)),
Texts( ],
'The delivery due date is estimated to be on the: ', ).withBorderedContainer,
fontWeight: FontWeight.w400, ),
),
Texts(
DateFormat.yMMMEd().format(deliveryDue),
fontWeight: FontWeight.w800,
fontSize: 21.0,
),
Container(
width: 350,
child: DefaultButton(
TranslationBase.of(context).seeDoctorsList,
() {
getDoctorsList(context);
},
),
),
],
), ),
), ),
), Container(
margin: EdgeInsets.symmetric(horizontal: 16.0, vertical: 16.0),
color: Colors.white,
child: SecondaryButton(
label: TranslationBase.of(context).viewDocList,
color: CustomColors.accentColor,
onTap: () {
getDoctorsList(context);
},
),
),
],
),
);
}
Widget showItem(String title, String value, {Color titleColor}) {
return Container(
width: double.infinity,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
title,
style: TextStyle(
fontSize: 14,
letterSpacing: -0.56,
color: titleColor ?? Colors.black,
fontWeight: FontWeight.w500,
// fontWeight: FontWeight.w600,
),
),
Text(
value,
style: TextStyle(
fontSize: 18,
letterSpacing: -1.08,
fontWeight: FontWeight.w600,
),
),
],
), ),
); );
} }
@ -148,26 +176,17 @@ class OvulationResult extends StatelessWidget {
List<PatientDoctorAppointmentList> doctorByHospital = _patientDoctorAppointmentListHospital List<PatientDoctorAppointmentList> doctorByHospital = _patientDoctorAppointmentListHospital
.where( .where(
(elementClinic) => elementClinic.filterName == element.projectName, (elementClinic) => elementClinic.filterName == element.projectName,
) )
.toList(); .toList();
if (doctorByHospital.length != 0) { if (doctorByHospital.length != 0) {
_patientDoctorAppointmentListHospital[_patientDoctorAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList.add(element); _patientDoctorAppointmentListHospital[_patientDoctorAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList.add(element);
} else { } else {
_patientDoctorAppointmentListHospital _patientDoctorAppointmentListHospital.add(PatientDoctorAppointmentList(filterName: element.projectName, distanceInKMs: "0", patientDoctorAppointment: element));
.add(PatientDoctorAppointmentList(filterName: element.projectName, distanceInKMs: "0", patientDoctorAppointment: element));
} }
}); });
Navigator.push( Navigator.push(context, FadePage(page: SearchResults(isLiveCareAppointment: false, doctorsList: doctorsList, patientDoctorAppointmentListHospital: _patientDoctorAppointmentListHospital)));
context,
FadePage(
page: SearchResults(
isLiveCareAppointment: false,
doctorsList: doctorsList,
patientDoctorAppointmentListHospital:
_patientDoctorAppointmentListHospital)));
} }
} }
}).catchError((err) { }).catchError((err) {
@ -175,5 +194,20 @@ class OvulationResult extends StatelessWidget {
print(err); print(err);
}); });
} }
}
extension BorderedContainer on Widget {
Widget get withBorderedContainer => Container(
padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15),
color: Colors.white,
border: Border.all(
color: Color(0xffefefef),
width: 1,
),
),
child: this,
);
} }

@ -1,7 +1,6 @@
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/core/model/family-file/add_family_file_request.dart'; import 'package:diplomaticquarterapp/core/model/family-file/add_family_file_request.dart';
import 'package:diplomaticquarterapp/core/model/family-file/insert_share_file_request.dart';
import 'package:diplomaticquarterapp/routes.dart'; import 'package:diplomaticquarterapp/routes.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/services/family_files/family_files_provider.dart'; import 'package:diplomaticquarterapp/services/family_files/family_files_provider.dart';
@ -17,7 +16,6 @@ import 'package:diplomaticquarterapp/widgets/mobile-no/mobile_no.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/otp/sms-popup.dart'; import 'package:diplomaticquarterapp/widgets/otp/sms-popup.dart';
import 'package:diplomaticquarterapp/widgets/progress_indicator/app_circular_progress_Indeicator.dart'; import 'package:diplomaticquarterapp/widgets/progress_indicator/app_circular_progress_Indeicator.dart';
import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -41,6 +39,7 @@ class _AddMember extends State<AddMember> {
var familyFileProvider = FamilyFilesProvider(); var familyFileProvider = FamilyFilesProvider();
var patientShareRequestID; var patientShareRequestID;
var patientShareResponseID;
@override @override
void initState() { void initState() {
@ -50,67 +49,71 @@ class _AddMember extends State<AddMember> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AppScaffold( return AppScaffold(
appBarTitle: TranslationBase.of(context).myFamilyFiles, appBarTitle: TranslationBase.of(context).myFamilyFiles,
isShowAppBar: true, isShowAppBar: true,
showNewAppBar: true, showNewAppBar: true,
showNewAppBarTitle: true, showNewAppBarTitle: true,
body: isLoading == true body: isLoading == true
? AppCircularProgressIndicator() ? AppCircularProgressIndicator()
: SingleChildScrollView( : SingleChildScrollView(
child: Container( child: Container(
padding: EdgeInsets.only(top: 10, left: 20, right: 20, bottom: 30), padding: EdgeInsets.all(21.0),
height: SizeConfig.realScreenHeight * .9, height: SizeConfig.realScreenHeight * .9,
width: SizeConfig.realScreenWidth, width: SizeConfig.realScreenWidth,
child: Column(children: <Widget>[ child: Column(
Expanded( children: <Widget>[
flex: 2, Expanded(
child: AppText( flex: 1,
TranslationBase.of(context).enterNationalId, child: Text(
fontSize: SizeConfig.textMultiplier * 3.5, loginType == 1 ? TranslationBase.of(context).enterNationalId : TranslationBase.of(context).enterFile,
textAlign: TextAlign.left, style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64, height: 23 / 16),
)), )),
Expanded( Expanded(
flex: 4, flex: 4,
child: Column(
// mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[
PhoneNumberSelectorWidget(onNumberChange: (value) => {mobileNo = value, validateForm()}, onCountryChange: (value) => countryCode = value),
//MobileNo(onNumberChange: (value) => {mobileNo = value, validateForm()}, onCountryChange: (value) => countryCode = value),
// Container(
// child: TextFields(
// controller: nationalIDorFile,
// onChanged: (value) => {validateForm()},
// prefixIcon: Icon(loginType == 1 ? Icons.chrome_reader_mode : Icons.receipt, color: Colors.red),
// padding: EdgeInsets.only(top: 20, bottom: 20, left: 10, right: 10),
// hintText: loginType == 1 ? TranslationBase.of(context).nationalID : TranslationBase.of(context).fileNo,
// ))
SizedBox(
height: 12,
),
inputWidget(loginType == 1 ? TranslationBase.of(context).nationalIdNumber : TranslationBase.of(context).medicalFileNumber, "Xxxxxxxxx", nationalIDorFile),
],
),
),
Expanded(
flex: 3,
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[ children: <Widget>[
Row( PhoneNumberSelectorWidget(onNumberChange: (value) => {mobileNo = value, validateForm()}, onCountryChange: (value) => countryCode = value),
children: <Widget>[ SizedBox(
Expanded( height: 12,
child: DefaultButton(
TranslationBase.of(context).add,
() => {this.addMember()},
color: isButtonDisabled == true ? Colors.grey : CustomColors.accentColor,
textColor: Colors.white,
))
],
), ),
inputWidget(loginType == 1 ? TranslationBase.of(context).nationalIdNumber : TranslationBase.of(context).medicalFileNumber, "Xxxxxxxxx", nationalIDorFile),
], ],
)) ),
]), ),
))); // Expanded(
// flex: 3,
// child: Column(
// mainAxisAlignment: MainAxisAlignment.end,
// children: <Widget>[
// Row(
// children: <Widget>[
// Expanded(
// child: DefaultButton(
// TranslationBase.of(context).add,
// () => {this.addMember()},
// color: isButtonDisabled == true ? Colors.grey : CustomColors.accentColor,
// textColor: Colors.white,
// ),
// )
// ],
// ),
// ],
// ),
// )
],
),
),
),
bottomSheet: Container(
color: Colors.white,
padding: EdgeInsets.all(21.0),
child: DefaultButton(
TranslationBase.of(context).add,
() => {this.addMember()},
color: isButtonDisabled == true ? Colors.grey : CustomColors.accentColor,
textColor: Colors.white,
)),
);
} }
void validateForm() { void validateForm() {
@ -158,31 +161,30 @@ class _AddMember extends State<AddMember> {
} }
insertFamilyData(addMemberResult) { insertFamilyData(addMemberResult) {
var request = InsertSharePatientFileReq(); sendActivationCode(addMemberResult);
request.responseID = addMemberResult['ShareFamilyFileObj']['ReponseID']; // var request = InsertSharePatientFileReq();
request.shareFamilyPatientName = addMemberResult['ShareFamilyFileObj']['SharedPatientName']; // request.responseID = addMemberResult['ShareFamilyFileObj']['ReponseID'];
request.status = 2; // request.shareFamilyPatientName = addMemberResult['ShareFamilyFileObj']['SharedPatientName'];
if (request.patientOutSA == 1) { // request.status = 2;
request.regionID = 2; // if (request.patientOutSA == 1) {
} else { // request.regionID = 2;
request.regionID = 1; // } else {
} // request.regionID = 1;
loading(true); // }
familyFileProvider.insertNewMember(request).then((value) => sendActivationCode(value)).catchError((err){ // loading(true);
loading(false); // familyFileProvider.insertNewMember(request).then((value) => sendActivationCode(value)).catchError((err) {
AppToast.showErrorToast(message: err); // loading(false);
}); // AppToast.showErrorToast(message: err);
// });
} }
sendActivationCode(result) { sendActivationCode(result) {
// var request = this.getCommonRequest(); // var request = this.getCommonRequest();
loading(true); loading(true);
patientShareRequestID = result['PatientShareRequestID']; patientShareResponseID = result['ShareFamilyFileObj']['ReponseID'];
familyFileProvider.sendActivationCode(mobileNo, countryCode, nationalIDorFile.text).then((result) => { familyFileProvider.sendActivationCode(mobileNo, countryCode, nationalIDorFile.text, patientShareResponseID).then((res) => {
if (result != null && result['isSMSSent'] == true) {this.startSMSService(1, result)} patientShareRequestID = res['PatientShareRequestID'],
// {loading(false), this.startSMSService(type)} if (res != null && res['isSMSSent'] == true) {this.startSMSService(1, res)}
// else
// {loading(false)}
}); });
} }
@ -207,7 +209,7 @@ class _AddMember extends State<AddMember> {
checkActivationCode(value, result) { checkActivationCode(value, result) {
Navigator.pop(context); Navigator.pop(context);
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
familyFileProvider.checkActivationCode(result['LogInTokenID'], value, nationalIDorFile.text, mobileNo).then((result) { familyFileProvider.checkActivationCode(result['LogInTokenID'], value, nationalIDorFile.text, mobileNo, patientShareRequestID, patientShareResponseID).then((result) {
SMSOTP.hideSMSBox(context); SMSOTP.hideSMSBox(context);
handleFamilyRequests(this.patientShareRequestID, 3); handleFamilyRequests(this.patientShareRequestID, 3);
}).catchError((err) { }).catchError((err) {
@ -219,12 +221,12 @@ class _AddMember extends State<AddMember> {
} }
handleFamilyRequests(id, stauts) { handleFamilyRequests(id, stauts) {
familyFileProvider.acceptAndRejectRecievedRequests(id, stauts).then((result) => { // familyFileProvider.acceptAndRejectRecievedRequests(id, stauts).then((result) => {
sharedPref.remove(FAMILY_FILE), sharedPref.remove(FAMILY_FILE);
Navigator.of(context).pushNamed( Navigator.of(context).pushNamed(
MY_FAMILIY, MY_FAMILIY,
) );
}); // });
} }
loading(flag) { loading(flag) {

@ -26,11 +26,11 @@ class AddFamilyMemberType extends StatelessWidget {
padding: EdgeInsets.zero, padding: EdgeInsets.zero,
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
children: [ children: [
SizedBox(height: 12), SizedBox(height: 21),
HabibLogoWidget(), HabibLogoWidget(),
SizedBox(height: 50), SizedBox(height: 21),
Text( Text(
TranslationBase.of(context).logintypeRadio, TranslationBase.of(context).registerInfoFamily,
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64, height: 23 / 16), style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64, height: 23 / 16),
), ),
GridView( GridView(

@ -27,7 +27,6 @@ import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/ConfirmWithMessageDialog.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/ConfirmWithMessageDialog.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart'; import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart';
@ -159,113 +158,115 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
if (snapshot.hasError) if (snapshot.hasError)
return Padding(padding: EdgeInsets.all(10), child: Text(TranslationBase.of(context).noDataAvailable)); return Padding(padding: EdgeInsets.all(10), child: Text(TranslationBase.of(context).noDataAvailable));
else else
return ListView.separated( return checkActive(snapshot.data.getAllSharedRecordsByStatusList) > 0
itemBuilder: (context, index) { ? ListView.separated(
if (snapshot.data.getAllSharedRecordsByStatusList[index].status == 3) itemBuilder: (context, index) {
return Container( if (snapshot.data.getAllSharedRecordsByStatusList[index].status == 3)
margin: EdgeInsets.all(5), return Container(
decoration: cardRadius( margin: EdgeInsets.all(5),
15, decoration: cardRadius(
elevation: 0, 15,
color: snapshot.data.getAllSharedRecordsByStatusList[index].gender == 2 ? Color(0xffFDA4B0) : Color(0xff6EA8FF), elevation: 0,
), color: snapshot.data.getAllSharedRecordsByStatusList[index].gender == 2 ? Color(0xffFDA4B0) : Color(0xff6EA8FF),
child: Container( ),
// height: 130,0xffFDA4B0 child: Container(
width: MediaQuery.of(context).size.width, // height: 130,0xffFDA4B0
padding: EdgeInsets.all(10), width: MediaQuery.of(context).size.width,
child: Row( padding: EdgeInsets.all(10),
mainAxisAlignment: MainAxisAlignment.spaceBetween, child: Row(
children: [ mainAxisAlignment: MainAxisAlignment.spaceBetween,
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Texts(
snapshot.data.getAllSharedRecordsByStatusList[index].patientName.toLowerCase().capitalizeFirstofEach,
fontSize: 18,
fontWeight: FontWeight.bold,
color: Colors.white,
),
Texts(TranslationBase.of(context).fileNumber + ': ' + snapshot.data.getAllSharedRecordsByStatusList[index].responseID.toString(),
fontSize: 12, color: Colors.white),
Texts(
snapshot.data.getAllSharedRecordsByStatusList[index].age.toString() +
' ' +
TranslationBase.of(context).years +
', ' +
snapshot.data.getAllSharedRecordsByStatusList[index].genderDescription,
fontSize: 12,
color: Colors.white),
],
),
Column(
children: [ children: [
SizedBox(height: 10), Column(
InkWell( crossAxisAlignment: CrossAxisAlignment.start,
onTap: () { children: <Widget>[
switchUser(snapshot.data.getAllSharedRecordsByStatusList[index], context); Texts(
}, snapshot.data.getAllSharedRecordsByStatusList[index].patientName.toLowerCase().capitalizeFirstofEach,
child: Container( fontSize: 18,
decoration: BoxDecoration(color: Colors.black.withOpacity(0.1), borderRadius: BorderRadius.circular(20)), fontWeight: FontWeight.bold,
padding: EdgeInsets.fromLTRB(15, 10, 15, 10), color: Colors.white,
child: Row( ),
mainAxisAlignment: MainAxisAlignment.center, Texts(TranslationBase.of(context).fileNumber + ': ' + snapshot.data.getAllSharedRecordsByStatusList[index].responseID.toString(),
children: [ fontSize: 12, color: Colors.white),
SvgPicture.asset("assets/images/new-design/switch.svg", Texts(
height: 22, color: snapshot.data.getAllSharedRecordsByStatusList[index].gender == 2 ? Color(0Xff5A282E) : Colors.white), snapshot.data.getAllSharedRecordsByStatusList[index].age.toString() +
SizedBox( ' ' +
width: 5, TranslationBase.of(context).years +
), ', ' +
// CupertinoSwitch( snapshot.data.getAllSharedRecordsByStatusList[index].genderDescription,
// value: isSwitchUser, fontSize: 12,
// onChanged: (value) { color: Colors.white),
// setState(() { ],
// isSwitchUser = value; ),
// }); Column(
// if (isSwitchUser == true) switchUser(snapshot.data.getAllSharedRecordsByStatusList[index], context); children: [
// }, SizedBox(height: 10),
// ), InkWell(
Texts(TranslationBase.of(context).switchUser, onTap: () {
color: snapshot.data.getAllSharedRecordsByStatusList[index].gender == 2 ? Color(0Xff5A282E) : Colors.white, switchUser(snapshot.data.getAllSharedRecordsByStatusList[index], context);
fontSize: 12, },
fontWeight: FontWeight.w600) child: Container(
], decoration: BoxDecoration(color: Colors.black.withOpacity(0.1), borderRadius: BorderRadius.circular(20)),
))), padding: EdgeInsets.fromLTRB(15, 10, 15, 10),
SizedBox( child: Row(
height: 10, mainAxisAlignment: MainAxisAlignment.center,
children: [
SvgPicture.asset("assets/images/new-design/switch.svg",
height: 22, color: snapshot.data.getAllSharedRecordsByStatusList[index].gender == 2 ? Color(0Xff5A282E) : Colors.white),
SizedBox(
width: 5,
),
// CupertinoSwitch(
// value: isSwitchUser,
// onChanged: (value) {
// setState(() {
// isSwitchUser = value;
// });
// if (isSwitchUser == true) switchUser(snapshot.data.getAllSharedRecordsByStatusList[index], context);
// },
// ),
Texts(TranslationBase.of(context).switchUser,
color: snapshot.data.getAllSharedRecordsByStatusList[index].gender == 2 ? Color(0Xff5A282E) : Colors.white,
fontSize: 12,
fontWeight: FontWeight.w600)
],
))),
SizedBox(
height: 10,
),
InkWell(
onTap: () {
deleteFamily(snapshot.data.getAllSharedRecordsByStatusList[index], context);
},
child: Container(
decoration: BoxDecoration(color: Colors.black.withOpacity(0.1), borderRadius: BorderRadius.circular(20)),
padding: EdgeInsets.fromLTRB(15, 10, 15, 10),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
SvgPicture.asset("assets/images/new-design/delete.svg",
height: 22, color: snapshot.data.getAllSharedRecordsByStatusList[index].gender == 2 ? Color(0Xff5A282E) : Colors.white),
SizedBox(
width: 5,
),
Texts(TranslationBase.of(context).delete,
color: snapshot.data.getAllSharedRecordsByStatusList[index].gender == 2 ? Color(0Xff5A282E) : Colors.white,
fontSize: 12,
fontWeight: FontWeight.w600),
],
))),
SizedBox(height: 10),
],
), ),
InkWell(
onTap: () {
deleteFamily(snapshot.data.getAllSharedRecordsByStatusList[index], context);
},
child: Container(
decoration: BoxDecoration(color: Colors.black.withOpacity(0.1), borderRadius: BorderRadius.circular(20)),
padding: EdgeInsets.fromLTRB(15, 10, 15, 10),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
SvgPicture.asset("assets/images/new-design/delete.svg",
height: 22, color: snapshot.data.getAllSharedRecordsByStatusList[index].gender == 2 ? Color(0Xff5A282E) : Colors.white),
SizedBox(
width: 5,
),
Texts(TranslationBase.of(context).delete,
color: snapshot.data.getAllSharedRecordsByStatusList[index].gender == 2 ? Color(0Xff5A282E) : Colors.white,
fontSize: 12,
fontWeight: FontWeight.w600),
],
))),
SizedBox(height: 10),
], ],
), )));
], // else if (checkActive(snapshot.data.getAllSharedRecordsByStatusList) == 0)
))); // return getNoDataWidget(context);
else if (checkActive(snapshot.data.getAllSharedRecordsByStatusList) == 0) else
return getNoDataWidget(context); return SizedBox(height: 0);
else },
return SizedBox(height: 0); separatorBuilder: (context, index) => SizedBox(height: 0),
}, itemCount: snapshot.data.getAllSharedRecordsByStatusList.length)
separatorBuilder: (context, index) => SizedBox(height: 0), : getNoDataWidget(context);
itemCount: snapshot.data.getAllSharedRecordsByStatusList.length);
} }
}, },
), ),
@ -290,176 +291,98 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
FractionallySizedBox( FractionallySizedBox(
widthFactor: 1.0, widthFactor: 1.0,
child: AppExpandableNotifier( child: AppExpandableNotifier(
title: TranslationBase.of(context).userViewRequest, title: TranslationBase.of(context).userViewRequest,
bodyWidget: FutureBuilder( bodyWidget: FutureBuilder(
future: getUserViewRequest(), // async work future: getUserViewRequest(), // async work
builder: (BuildContext context, AsyncSnapshot<dynamic> snapshot) { builder: (BuildContext context, AsyncSnapshot<dynamic> snapshot) {
switch (snapshot.connectionState) { switch (snapshot.connectionState) {
case ConnectionState.waiting: case ConnectionState.waiting:
return SizedBox(); return SizedBox();
default: default:
if (snapshot.hasError) if (snapshot.hasError)
return Padding(padding: EdgeInsets.all(10), child: Text(TranslationBase.of(context).noDataAvailable)); return Padding(padding: EdgeInsets.all(10), child: Text(TranslationBase.of(context).noDataAvailable));
else else
return ListView.separated( return ListView.separated(
shrinkWrap: true, shrinkWrap: true,
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
padding: EdgeInsets.only(bottom: 14, top: 14, left: 21, right: 21), padding: EdgeInsets.only(bottom: 14, top: 14, left: 21, right: 21),
itemBuilder: (context, _index) { itemBuilder: (context, _index) {
return Container( return Container(
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(
Radius.circular(10.0), Radius.circular(10.0),
), ),
border: Border.all(width: 1, color: Color(0xffEFEFEF)), border: Border.all(width: 1, color: Color(0xffEFEFEF)),
boxShadow: [ boxShadow: [
BoxShadow( BoxShadow(
color: Color(0xff000000).withOpacity(.05), color: Color(0xff000000).withOpacity(.05),
//spreadRadius: 5, //spreadRadius: 5,
blurRadius: 27, blurRadius: 27,
offset: Offset(0, -3), offset: Offset(0, -3),
), ),
], ],
color: Colors.white), color: Colors.white),
child: Column( child: Column(
children: [ children: [
Column(children: [ Column(children: [
Padding( Padding(
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
child: Row(children: [ child: Row(children: [
Expanded(flex: 3, child: AppText(TranslationBase.of(context).name, fontWeight: FontWeight.w600)), Expanded(flex: 3, child: AppText(TranslationBase.of(context).name, fontWeight: FontWeight.w600)),
Expanded(flex: 1, child: AppText(TranslationBase.of(context).allow, fontWeight: FontWeight.w600)), Expanded(flex: 1, child: AppText(TranslationBase.of(context).allow, fontWeight: FontWeight.w600)),
Expanded(flex: 1, child: AppText(TranslationBase.of(context).reject, fontWeight: FontWeight.w600)), Expanded(flex: 1, child: AppText(TranslationBase.of(context).reject, fontWeight: FontWeight.w600)),
])), ])),
Padding( Padding(
padding: const EdgeInsets.only(left: 10.0, right: 10.0), padding: const EdgeInsets.only(left: 10.0, right: 10.0),
child: Divider(color: Colors.black, height: 1.5, thickness: 1.5), child: Divider(color: Colors.black, height: 1.5, thickness: 1.5),
), ),
Column( Column(
children: familyFileProvider.allSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList.map<Widget>((result) { children: familyFileProvider.allSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList.map<Widget>((result) {
return Container( return Container(
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
child: Row( child: Row(
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
flex: 3, flex: 3,
child: Texts( child: Texts(
result.patientName, result.patientName,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 12, fontSize: 12,
)), )),
Expanded( Expanded(
flex: 1, flex: 1,
child: IconButton( child: IconButton(
icon: SvgPicture.asset("assets/images/new-design/allow.svg", height: 22), icon: SvgPicture.asset("assets/images/new-design/allow.svg", height: 22),
onPressed: () { onPressed: () {
acceptRemoveRequest(result.iD, 3, context); acceptRemoveRequest(result.iD, 3, context);
}, },
)), )),
Expanded( Expanded(
flex: 1, flex: 1,
child: IconButton( child: IconButton(
icon: SvgPicture.asset("assets/images/new-design/reject.svg", height: 22), icon: SvgPicture.asset("assets/images/new-design/reject.svg", height: 22),
color: Colors.white, color: Colors.white,
onPressed: () { onPressed: () {
acceptRemoveRequest(result.iD, 4, context); acceptRemoveRequest(result.iD, 4, context);
}, },
)) ))
], ],
)); ));
}).toList()) }).toList())
]) ])
], ],
)); ));
}, },
separatorBuilder: (context, index) => SizedBox(height: 14), separatorBuilder: (context, index) => SizedBox(height: 14),
itemCount: 1); itemCount: 1);
} }
}, },
))), ),
),
// RoundedContainer( ),
// child: ExpansionTile(
// title: Text(
// TranslationBase.of(context).userViewRequest,
// style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold, color: Colors.black),
// ),
// children: <Widget>[
// FutureBuilder(
// future: getUserViewRequest(), // async work
// builder: (BuildContext context, AsyncSnapshot<dynamic> snapshot) {
// switch (snapshot.connectionState) {
// case ConnectionState.waiting:
// return Padding(padding: EdgeInsets.only(top: 50), child: Text('Loading....'));
// default:
// if (snapshot.hasError)
// return Padding(padding: EdgeInsets.all(10), child: Text(TranslationBase.of(context).noDataAvailable));
// else
// return Container(
// padding: EdgeInsets.all(15),
// child: Card(
// elevation: 3,
// shape: cardRadius(8),
// child: Column(
// children: [
// Column(children: [
// Padding(
// padding: EdgeInsets.all(10),
// child: Row(children: [
// Expanded(flex: 3, child: AppText(TranslationBase.of(context).name, fontWeight: FontWeight.w600)),
// Expanded(flex: 1, child: AppText(TranslationBase.of(context).allow, fontWeight: FontWeight.w600)),
// Expanded(flex: 1, child: AppText(TranslationBase.of(context).reject, fontWeight: FontWeight.w600)),
// ])),
// Divider(color: Colors.black, height: 1.5, thickness: 1.5),
// Column(
// children: familyFileProvider.allSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList.map<Widget>((result) {
// return Container(
// padding: EdgeInsets.all(10),
// child: Row(
// children: <Widget>[
// Expanded(
// flex: 3,
// child: Texts(
// result.patientName,
// fontWeight: FontWeight.w600,
// fontSize: 12,
// )),
// Expanded(
// flex: 1,
// child: IconButton(
// icon: Icon(
// Icons.check_circle,
// color: Color(0xff349745),
// ),
// onPressed: () {
// acceptRemoveRequest(result.iD, 3, context);
// },
// )),
// Expanded(
// flex: 1,
// child: IconButton(
// icon: Icon(
// Icons.close,
// color: Colors.red[900],
// ),
// onPressed: () {
// acceptRemoveRequest(result.iD, 4, context);
// },
// ))
// ],
// ));
// }).toList())
// ])
// ],
// )));
// }
// })
// ],
// ),
// ),
SizedBox(height: 15), SizedBox(height: 15),
FractionallySizedBox( FractionallySizedBox(
widthFactor: 1.0, widthFactor: 1.0,
@ -521,18 +444,21 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
fontSize: 12, fontSize: 12,
)), )),
Expanded( Expanded(
flex: 1, flex: 1,
child: Card( child: Card(
// shape: cardRadius(10), // shape: cardRadius(10),
color: result.status == 3 ? Color(0xff349745) : Color(0xffD02127), color: result.status == 3 ? Color(0xff349745) : Color(0xffD02127),
child: Padding( child: Padding(
padding: EdgeInsets.all(5), padding: EdgeInsets.all(5),
child: AppText( child: AppText(
result.statusDescription, result.statusDescription != null ? result.statusDescription : "",
color: Colors.white, color: Colors.white,
textAlign: TextAlign.center, textAlign: TextAlign.center,
fontSize: 12, fontSize: 12,
)))), ),
),
),
),
], ],
)); ));
}).toList(), }).toList(),

@ -140,7 +140,7 @@ class FamilyFilesProvider with ChangeNotifier {
} }
} }
Future<dynamic> sendActivationCode(cellNumber, zipCode, patientIdentificationID) async { Future<dynamic> sendActivationCode(cellNumber, zipCode, patientIdentificationID, responseID) async {
try { try {
dynamic localRes; dynamic localRes;
var request = SendActivationRequest(); var request = SendActivationRequest();
@ -151,6 +151,8 @@ class FamilyFilesProvider with ChangeNotifier {
request.loginType = request.searchType = 1; request.loginType = request.searchType = 1;
request.oTPSendType = 1; request.oTPSendType = 1;
request.isRegister = false; request.isRegister = false;
request.responseID = responseID;
request.status = 2;
await new BaseAppClient().post(SEND_FAMILY_FILE_ACTIVATION, onSuccess: (dynamic response, int statusCode) { await new BaseAppClient().post(SEND_FAMILY_FILE_ACTIVATION, onSuccess: (dynamic response, int statusCode) {
localRes = response; localRes = response;
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
@ -166,7 +168,7 @@ class FamilyFilesProvider with ChangeNotifier {
} }
//TODO //TODO
Future<dynamic> checkActivationCode(loginTokenID, activationCode, indentification, mobileNo) async { Future<dynamic> checkActivationCode(loginTokenID, activationCode, indentification, mobileNo, requestID, responseID) async {
try { try {
dynamic localRes; dynamic localRes;
Map<String, dynamic> request = {}; Map<String, dynamic> request = {};
@ -175,6 +177,10 @@ class FamilyFilesProvider with ChangeNotifier {
request['PatientIdentificationID'] = indentification; request['PatientIdentificationID'] = indentification;
request['LogInTokenID'] = loginTokenID; request['LogInTokenID'] = loginTokenID;
request['activationCode'] = activationCode; request['activationCode'] = activationCode;
request['PatientShareRequestID'] = requestID;
request['ResponseID'] = responseID;
request['Status'] = 3;
// this.authService.authenticateRequest(request); // this.authService.authenticateRequest(request);
await new BaseAppClient().post(CHECK_ACTIVATION_CODE, onSuccess: (dynamic response, int statusCode) { await new BaseAppClient().post(CHECK_ACTIVATION_CODE, onSuccess: (dynamic response, int statusCode) {
localRes = response; localRes = response;

@ -509,7 +509,7 @@ class TranslationBase {
String get switchUser => localizedValues['switch-login'][locale.languageCode]; String get switchUser => localizedValues['switch-login'][locale.languageCode];
String get removeMember => localizedValues['remove-member'][locale.languageCode]; String get removeMember => localizedValues['remove-membe'][locale.languageCode];
String get allowView => localizedValues['allow-view'][locale.languageCode]; String get allowView => localizedValues['allow-view'][locale.languageCode];
@ -1770,8 +1770,6 @@ class TranslationBase {
String get requestSent => localizedValues['request-sent'][locale.languageCode]; String get requestSent => localizedValues['request-sent'][locale.languageCode];
String get submitReview => localizedValues['submitReview'][locale.languageCode];
String get attachInsuraceImage => localizedValues['attach-insurace-image'][locale.languageCode]; String get attachInsuraceImage => localizedValues['attach-insurace-image'][locale.languageCode];
String get infoInsurCards => localizedValues['info-insur-cards'][locale.languageCode]; String get infoInsurCards => localizedValues['info-insur-cards'][locale.languageCode];
@ -2692,6 +2690,64 @@ class TranslationBase {
String get dietUSDA => localizedValues["dietUSDA"][locale.languageCode]; String get dietUSDA => localizedValues["dietUSDA"][locale.languageCode];
String get dietZone => localizedValues["dietZone"][locale.languageCode]; String get dietZone => localizedValues["dietZone"][locale.languageCode];
String get useFullInfo => localizedValues["usefulInfo"][locale.languageCode];
String get babyAge => localizedValues["babyAge"][locale.languageCode];
String get babyAgeAvail => localizedValues["babyAgeAvail"][locale.languageCode];
String get deliveryDue => localizedValues["deliveryDue"][locale.languageCode];
String get almostInactive => localizedValues["almostInactive"][locale.languageCode];
String get lightActive1 => localizedValues["lightActive1"][locale.languageCode];
String get veryActive => localizedValues["veryActive"][locale.languageCode];
String get superActive => localizedValues["superActive"][locale.languageCode];
String get dailyIntake => localizedValues["dailyIntake"][locale.languageCode];
String get calculateAmount => localizedValues["calculateAmount"][locale.languageCode];
String get bodyWillBurn => localizedValues["bodyWillBurn"][locale.languageCode];
String get caloriesEachDay => localizedValues["caloriesEachDay"][locale.languageCode];
String get maintainWeight => localizedValues["maintainWeight"][locale.languageCode];
String get mediumFinger => localizedValues["mediumFinger"][locale.languageCode];
String get smallFinger => localizedValues["smallFinger"][locale.languageCode];
String get largeFinger => localizedValues["largeFinger"][locale.languageCode];
String get idealBodyWeight => localizedValues["idealBodyWeight"][locale.languageCode];
String get bodyFrameSize => localizedValues["bodyFrameSize"][locale.languageCode];
String get idealWeightRange => localizedValues["idealWeightRange"][locale.languageCode];
String get currentWeightPerfect => localizedValues["currentWeightPerfect"][locale.languageCode];
String get littleBitWeightMore => localizedValues["littleBitWeightMore"][locale.languageCode];
String get consultWithDoctor => localizedValues["consultWithDoctor"][locale.languageCode];
String get excessiveObesity => localizedValues["excessiveObesity"][locale.languageCode];
String get mayWish => localizedValues["mayWish"][locale.languageCode];
String get underObese => localizedValues["underObese"][locale.languageCode];
String get crossedLimits => localizedValues["crossedLimits"][locale.languageCode];
String get lowLimits => localizedValues["lowLimits"][locale.languageCode];
String get estimates => localizedValues["estimates"][locale.languageCode];
String get submitReview => localizedValues["submitReview"][locale.languageCode];
} }
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> { class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

Loading…
Cancel
Save