From dbda69baa15f9b45cf198ca8273e4844de4e7b0e Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Wed, 7 Oct 2020 12:44:17 +0300 Subject: [PATCH 1/2] health Calculator'General Health' --- assets/images/medical/BMR_calculator.png | Bin 0 -> 3177 bytes .../images/medical/bmi_health_calculator.png | Bin 0 -> 2209 bytes assets/images/medical/body_fat.png | Bin 0 -> 4309 bytes assets/images/medical/body_weight.png | Bin 0 -> 2775 bytes assets/images/medical/calories-calculator.png | Bin 0 -> 3309 bytes assets/images/medical/carb_protein.png | Bin 0 -> 3732 bytes assets/images/medical/delivery_date_icon.png | Bin 0 -> 8713 bytes .../images/medical/ovulation_period_icon.png | Bin 0 -> 2506 bytes .../all_habib_medical_service_page.dart | 5 +- .../bmi_calculator/bmi_calculator.dart | 521 +++++++++ .../bmi_calculator/result_page.dart | 101 ++ .../bmr_calculator/bmr_calculator.dart | 721 ++++++++++++ .../bmr_calculator/bmr_result_page.dart | 65 ++ .../health_calculator/body_fat/body_fat.dart | 1003 +++++++++++++++++ .../body_fat/body_fat_result_page.dart | 77 ++ .../calorie_calculator.dart | 676 +++++++++++ .../calorie_result_page.dart | 59 + .../health_calculator/carbs/carbs.dart | 367 ++++++ .../carbs/carbs_result_page.dart | 175 +++ .../ideal_body/ideal_body.dart | 550 +++++++++ .../ideal_body/ideal_body_result_page.dart | 170 +++ .../health_converter/blood_cholesterol.dart | 2 +- .../​ health_calculators.dart | 279 +++++ pubspec.yaml | 3 + 24 files changed, 4772 insertions(+), 2 deletions(-) create mode 100644 assets/images/medical/BMR_calculator.png create mode 100644 assets/images/medical/bmi_health_calculator.png create mode 100644 assets/images/medical/body_fat.png create mode 100644 assets/images/medical/body_weight.png create mode 100644 assets/images/medical/calories-calculator.png create mode 100644 assets/images/medical/carb_protein.png create mode 100644 assets/images/medical/delivery_date_icon.png create mode 100644 assets/images/medical/ovulation_period_icon.png create mode 100644 lib/pages/AlHabibMedicalService/health_calculator/bmi_calculator/bmi_calculator.dart create mode 100644 lib/pages/AlHabibMedicalService/health_calculator/bmi_calculator/result_page.dart create mode 100644 lib/pages/AlHabibMedicalService/health_calculator/bmr_calculator/bmr_calculator.dart create mode 100644 lib/pages/AlHabibMedicalService/health_calculator/bmr_calculator/bmr_result_page.dart create mode 100644 lib/pages/AlHabibMedicalService/health_calculator/body_fat/body_fat.dart create mode 100644 lib/pages/AlHabibMedicalService/health_calculator/body_fat/body_fat_result_page.dart create mode 100644 lib/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_calculator.dart create mode 100644 lib/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_result_page.dart create mode 100644 lib/pages/AlHabibMedicalService/health_calculator/carbs/carbs.dart create mode 100644 lib/pages/AlHabibMedicalService/health_calculator/carbs/carbs_result_page.dart create mode 100644 lib/pages/AlHabibMedicalService/health_calculator/ideal_body/ideal_body.dart create mode 100644 lib/pages/AlHabibMedicalService/health_calculator/ideal_body/ideal_body_result_page.dart create mode 100644 lib/pages/AlHabibMedicalService/​ health_calculators.dart diff --git a/assets/images/medical/BMR_calculator.png b/assets/images/medical/BMR_calculator.png new file mode 100644 index 0000000000000000000000000000000000000000..2c32b80da9aa28ade902c8324a2f3d28babeee59 GIT binary patch literal 3177 zcmV-v43_hWP)b6jsoye06zlovPGy3waz>j@p&br z=^-?B1n{h?dt7a^&Q07Z1hkEUv*9~RnD^E?<6Ok40Cou>tpw2CLg%?kn7cW(@o)$O z0K94$7yk(09VGLu0Is&w`J@-5d-z=eEp{^%B>nr`T4$V#I7$iWDFAz7OjTyrI^$eI z4*;V8oB`lYi)Q@4fITA6i%N}Tq!I3smRq)qI`>!kEisYa=g-S$;wv@>3PsVy99JtA<5vig{L5vY`zdc zxi;F*sF&>p&TTy`=wQ(-Kb!!g%vd*$t1e0421VnQwIrcx0KOL2)-M?s1a202!Xh$xk=oi1x zf_|JbA&mEN%yFLUG5Zhep~6ZW)4Yfuq5X?1_=7Lh~q<5ZyLH}SV*9!iQ_d1_5WG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qWvFRd*-UK{mHSXJt|(OeUS1kKs{Fi7I?urk8ZSC%Mg{P z>%{hrt_H(;#DiII7}ky}0Ou46Q}b{ddnv>JOGq`68v=NvLgkbe%IwX!7n@0}2Ui@5 zO)xQE`0JRJjW76*IubVsGwIS2LN)er(S5i4(U$9PcZnHKWH4=W1;)Z;4Y_pIloY>e zEhN9{5hoj`4c(Zse2`dQlrAU(A~r<_6Zzg{QN#vur=&^RAIW0s zXvWp=seqbN%VO1bPbOEcbwwvAd&%q6l4W&{*r>IXqFq#Uq?<4QEf16Ti9_#nRPNh% zz9O)W{z!h>ba1&QX<_zPM&L$f7%3|&hldqi$=gQ3?*k=nIuMF!>a9sDKE&gH&@ryD zVnyRlTcifNgA-wobg`7Yw#lGufy%CRcSJppWFdJSYj`Vl9$GBAFvj$_jC0oRp{?_F z%e4vg(~a^SZlsCs@f2yy1v2blQwant%2`XCq3D@Z#J&4+%!XZP_r`;eh3T(9L-q26 z-rcB}ZNBQ$N?wr$vgmSk!iqH+<=-7F7VWj)sx&QbS6&+dPN0bsl{7ueY7CW_o{^S( z2|ecvVOdDL$?7CCcx45@+EQik0#26w4N#F0a9Idc zZ^nLo2G7(8%WDgIs6UwlO{pM@F82ioQsk^v=f&=Y=Gxw)p~ym@CerL&Cg;xsCROTJ z)pO?*k#^vrG@`%KLRMqwFPX%6M8oC4=ehU*ESiHjT2S8$9>Fa@MFcelsBie~sG})F4{94cApFW2V_TVm5bsvY`X_l#v@8n08K1 zdMqEo1WC1?@1WRnw<pMc&^;-p4{Q)0Xwzp>Shz??_ERYxTu!PP>sjUmy2|QnvZ1 z=bk4MxC2oh=EF*W`MOpB__i9BjG|-qa0%N9(bP4&M44&cZ!DI!Z~*u>RGKyPIvF6I P00000NkvXXu0mjfWD5>` literal 0 HcmV?d00001 diff --git a/assets/images/medical/bmi_health_calculator.png b/assets/images/medical/bmi_health_calculator.png new file mode 100644 index 0000000000000000000000000000000000000000..2eb494408ac68ae525b49b1bfa56bde5aafb376b GIT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yfu%3TRyzF_{+93f+W zlcebcN|Cz!mh-Uvb^wb;Dh869am*+yt z)}*FDsFZ#l;oZwvMq74J$C05%FRb*)OHYYXq}A^<;dLhZ@Uc!o?0XDOQf|>hK3tH5 zmE_fRP%!vR2(M;$qYkYh-z}6ei9KMl~|lRePSvB_Ikp zH{lbCF*WW(6~-qZV#*6@*$6gi0;X)W2{v1Su2ZP2{u_n0!&*cFkZ z$UvPml1ge*cCd44s!lu@twWmIA{pR+wy2M6%qGLKCLeU#5GGia5znj9-qrT8qD2G1y% zC0Cze{)3hk{?W=ZWfU)1_6$>Zd!JCoLd)WNSKd(RjE_?0TbxW44oX>KDbOAVrI68m z(~^%^O3Aup1DR3`WJ)oRDaC+~p{=xx8C=E@11(kSfJA9+C0`U$@s|fl7_(uZ<}qX9-_5BK4;{5hILZD+d+_jN_PC7a99` zOMd{_kDZP(DBgEUNZFc92-~nyf{D^#%MxTjiR1+eOg(=yx?i-Iy?2tiQ1I>QuF&AE zW76=l?GfQ!Rmz(7W>-Ud(6cFl3%J=+Mx%$nHxd`6jNnP2w5zM`i;UQ>K=Dz^8jpJe=EyD!WpdIl zEYF&c0jW}UdORbDz&_ydF8%|`XK~<-fv|U39!07Y3OWBUMkX4R*OJk!`S}+H1xr4y846x>DvN`Y2I;v4z4hrO}Tqh2HGd%ds9x0^h_? z4x1tc)p7eP)K@pVP|Uvr(2o7jRUGDel))bE!a`5$RC}s>u}E{|+_{P^d`talEP`4D j`DUo2A!pbBEd#)RN<(b-`aAnp00000NkvXXu0mjfec~A1 literal 0 HcmV?d00001 diff --git a/assets/images/medical/body_fat.png b/assets/images/medical/body_fat.png new file mode 100644 index 0000000000000000000000000000000000000000..3dd3615078a66ed8457e11edda369a7b682b952f GIT binary patch literal 4309 zcmV;`5GwD9P)d(cru)2p-T!s>UAv45 z58oxCBZz1pBHD$Bwj`p>iKvl?{!2u2h-f?!jU}QF9KCNxL_>+FKN0mNq6Q+WBcc^V zw3LYE646^k^fJR?o_R144IrXD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u0mjf Do~aw3 literal 0 HcmV?d00001 diff --git a/assets/images/medical/body_weight.png b/assets/images/medical/body_weight.png new file mode 100644 index 0000000000000000000000000000000000000000..d1f0b324620bff4bbefccdd4589626e1f2414cc0 GIT binary patch literal 2775 zcmd6p`yfc#=du+IrP!sJTrxRWWhc~Og+wmNL8B#? z$u+CfWiBI^IgDy@StK#HMDyLB@%`cbe*f_N@_v4KUQddrJ4Q`KR|Nn7HLR0^m;6S^ zCv20Fe6O`(@&Q1l0PA4qL(lu3ulCgEt>*iU=3B|z!#{$3_jd9B@lxG(S%q|fkI8!c zca;LifOB-9Hg#bCQZa|>dO6qFT$lXZnR4N`GZBHKR`?=(pOc;oZ|wHG6jYkR1ge`( zYHAjtCeH1e{P<#KxFsg$^P$#pI8E{?9~C2uInk9fURpeBw64%8xtb>rVOGJVkcieei;8}tAi6wb>kw5SBp!MtKoE_W$Y7!1o| z*#n)Ra3rJHp8x?>Z{|@&xwcE=J!CB}XsiN*0vZ7ad1m>?0D}ra77Xcm!;>b9%5&zx zdoT<5gJY~bja+7?}X$sF-@9hd-00+Tyn;F_%lvmv%&SDjTGfz3O8{yier!!gmK=t~(iIE7xle_1h zaM)3JS6}&~HK0!A52J=O#qhn1TU_MY@FVpbXedgLM;LJ?;6M*bIYYV2ypJmEq;)Mu zAid24^3zePZ^9`$lcfzgBNkwY%{KP_-sM;)`1lYY6LTG|xr8Nip2r%)FrY_6-=OYA z9UxcXz)ZB-)FQ_VU9d@v0w8(gg+xlinesPS;t_;z`*14rH4XHqaK2AbfOpQ4);vQH z{Nz5M3^Ob23W*XTA+>5q>C+paJf$GZodhcR6PeF_Jo`Ox1Wl}y*`+Pn_f)sW*=bK- z$lho0iyl~?^jOus*Ourfw{Nx&(h7(%Kv$Syd%x1dOipE@Lh!VQ-KwCCmyjU4%Vr1n95ailF zux>II@e2XN^aZwaWzPI7&U}xHXG`lQ2~>eE5EgT9Z9#9hcP(;bl5y>I6#QbL10T`F z%pduENs!*M{_+`T$cLs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6SWqAG zG*^Phf^7ND2^AJ&S$WMBEiL8Lst`H%asvl0Z_S4_?)I#2p3pB4U9&wsXr6f#d9pjw zBI_rW#IeZSFfXhvF2hk0=V+Uwol7~_sQ+U`x~jmRndzsb4ilBmIaju*Hs#Iy2EYxW zTmZ*8;YIqYy~lxb4%3#?W|cjSOV2Pd#I6vpplT6Bq^f{(gXV(CnhQ`6Cy^p^gXDsp zHW^w`+@It`Z@A&hC9I1NY+PW~wHL)*N^--d7zd8LAeIYIFh@Yi4Q-Y8WFFDel?&j& z2_3k@b6p*+4w-x}VI^G4v3=)qL4mm85f?595J!X&2{voDTFQAeK{>rt8JDW-wlHax zwC5>hc>bOao7ZD-8ICFwRKn&Qm_|ACl*j!@3pdQ9^WM@DN?&D2xLt8p=)SU}mz48{ z#H0whl7=zp`kCc?r9)J%Y7xRMm>XmxyYjawiBMxHBTMvDAsZs+0-4EGc9gY$LMz3_ z+Gj1ml8Cus5dDj%mndYjoC|iV03=ovHB5qDDan1qEZX@Dj_@PM3YrV%Bk5H{$NIAZOxx47V4Z#gl#PvHFB5k+DB2c0!qX(=? z_&w^bDgc!;7X&DhN54jyuyQ^^_aq-RD@cHaVx^@Gl3g%Et%y$bxw(llPPI*5VG&!R zVEedsTIEO_;oBY{Y;K6cIPuAtwp`l!j1YC^0)txw6>Z<5$&>8JhPrUW3|PvqwBzbfzTNh=iHW;TBGsGG_hgtiZeCFG2KAu13 rUK5~|7>eeu!Pa-{800000NkvXXu0mjf#~?xR literal 0 HcmV?d00001 diff --git a/assets/images/medical/carb_protein.png b/assets/images/medical/carb_protein.png new file mode 100644 index 0000000000000000000000000000000000000000..eb6c664047e682238647df697e0d995fd5294135 GIT binary patch literal 3732 zcmV;F4r}p=P)7%9zh#91rX=F-ZZEBQQS|A#U zrG|zfN|Axd1D2N{4MJeKE-Wnf?K$xNdi*>y|CyOH^Pm6nKF>V6Gyj~+%s1yd-}!E* z1^h;50EYuO7(fGn$O^ z(7N1ToX_|ufHxx$RX_d-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zC;NP$uVr`KR{FLSp7gC_UauBzGmF%ZJ1ku88+_1K+}ISX?P!>3xew_H^nq&2v6pt6 zrv8@B`l#+%44i1Wk48^#{)$5v4g*T|FAd9;M-n#EEV;5oC*D9wH$KbrW-35jO@eS+ z9T%6CatP-ZdG=3(F^V;Iy^nVhF^HF&6*gm&rKBa-|LJK5pZ&CvKraW`KBXOs5j>%= z)o7X*hg$?Gm+qe)@oFWYi;zCyud_O5kwoU9-uXyl8( zj29FVs@ONbz(IHHuo51tM=Qfx8+ehwgi{lWg^gUS=Q*V}@Jffe00Ahn^9i3ZTEl^p z?b#);hoi2k9Pw(geenPA>a_O_-n}?X%BYV|xeQy~`DyCt#A_W`giDH?qkeaiWochN z+1rsxmkR2{p-$OI_e9}{PQP7xldBRf&g>KKL zxUa#SY3qah*Bv8MYV_d@DNUk%G1~VjPud08ksqq}9lwA@d=7PBQo}CW`_BB74CkD@ ztrEN$CJo4SOYRCPR_XP9&b%6;7y3~wmWBy(j8UTu1RBa{BSc<8iWbqAo*V%F22>dZ U=VTw@!vFvP07*qoM6N<$g4U|Q?*IS* literal 0 HcmV?d00001 diff --git a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart index 6854cb27..b3387b34 100644 --- a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart +++ b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart @@ -1,3 +1,4 @@ +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/%E2%80%8B%20health_calculators.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_converter.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/parking_page.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/BookingOptions.dart'; @@ -216,7 +217,9 @@ class _AllHabibMedicalServiceState extends State { ServicesContainer( onTap: () => Navigator.push( context, - FadePage(), + FadePage( + page: (HealthCalculators()), + ), ), imageLocation: 'assets/images/new-design/health_calculator_icon.png', diff --git a/lib/pages/AlHabibMedicalService/health_calculator/bmi_calculator/bmi_calculator.dart b/lib/pages/AlHabibMedicalService/health_calculator/bmi_calculator/bmi_calculator.dart new file mode 100644 index 00000000..62729222 --- /dev/null +++ b/lib/pages/AlHabibMedicalService/health_calculator/bmi_calculator/bmi_calculator.dart @@ -0,0 +1,521 @@ +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/bmi_calculator/result_page.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'dart:math'; + +const activeCardColor = Color(0xff70777A); +const inactiveCardColor = Color(0xffFAFAFd); + +class BMICalculator extends StatefulWidget { + @override + _BMICalculatorState createState() => _BMICalculatorState(); +} + +class _BMICalculatorState extends State { + TextEditingController textController = new TextEditingController(); + String textResult; + String msg; + double bmiResult; + int height = 150; + int weight = 40; + Color cmCard = activeCardColor; + Color ftCard = inactiveCardColor; + Color lbCard = inactiveCardColor; + Color kgCard = activeCardColor; + void updateColor(int type) { + //MG/DLT card + if (type == 1) { + if (cmCard == inactiveCardColor) { + cmCard = activeCardColor; + ftCard = inactiveCardColor; + } else { + cmCard = inactiveCardColor; + } + } + if (type == 2) { + if (ftCard == inactiveCardColor) { + ftCard = activeCardColor; + cmCard = inactiveCardColor; + } else { + ftCard = inactiveCardColor; + } + } + } + + void updateColorWeight(int type) { + //MG/DLT card + if (type == 1) { + if (kgCard == inactiveCardColor) { + kgCard = activeCardColor; + lbCard = inactiveCardColor; + } else { + kgCard = inactiveCardColor; + } + } + if (type == 2) { + if (lbCard == inactiveCardColor) { + lbCard = activeCardColor; + kgCard = inactiveCardColor; + } else { + lbCard = inactiveCardColor; + } + } + } + + double convertToCm(double number) { + return number * 30.48; + } + + double convertToKg(double number) { + return number / 2.205; + } + + double calculateBMI() { + if (ftCard == activeCardColor) { + convertToCm(height.toDouble()); + } + bmiResult = weight / pow(height / 100, 2); + + return bmiResult; + } + + void showTextResult() { + if (bmiResult >= 30) { + textResult = 'Obese'; + } else if (bmiResult < 30 && bmiResult >= 25) { + textResult = 'OverWeight'; + } else if (bmiResult < 25 && bmiResult >= 18.5) { + textResult = 'Healthy'; + } else if (bmiResult < 18.5) { + textResult = 'UnderWeight'; + } + } + + void showMsg() { + if (bmiResult >= 30) { + msg = + 'A BMI of over 30 indicates that are heavily overweight. Health may be at risk if not lose weight. Recommended talking to a doctor or a dietician for advice. To book an appointment, click below to get started.'; + } else if (bmiResult < 30 && bmiResult >= 25) { + msg = + 'A BMI of 25 - 30 indicates that are slightly overweight. May be advised to lose some weight for health reasons. Recommended talking to a doctor or a dietician for advice. To book an appointment, click below to get '; + } else if (bmiResult < 25 && bmiResult >= 18.5) { + msg = + 'A BMI of 18.5 - 25 indicates that are at a healthy weight for the height. By maintaining a healthy weight, lower the risk of developing severe health problems. To book an appointment, click below to get started.'; + } else if (bmiResult < 18.5) { + msg = + 'A BMI of less than 18.5 indicates that are underweight, so may need to put on some weight. Recommended talking to a doctor or a dietician for advice. To book an appointment, click below to get started.'; + } + } + + @override + void initState() { + super.initState(); + textController.text = '0'; // Setting the initial value for the field. + } + + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: true, + appBarTitle: 'BMI Calculator', + body: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Center( + child: Container( + width: 350.0, + child: Padding( + padding: EdgeInsets.symmetric(vertical: 15.0), + child: Text( + 'Calculate the BMI value and weight\n status to identify the healthy weight .\n Not appropriate for children and women\n who are pregnant or breastfeeding', + style: TextStyle(fontSize: 18.0), + ), + ), + ), + ), + Container( + height: 200.0, + width: 350.0, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(12.0), + ), + child: Column( + children: [ + Row( + children: [ + Padding( + padding: EdgeInsets.all(8.0), + child: Texts('Height'), + ), + ], + ), + Row( + children: [ + Padding( + padding: EdgeInsets.symmetric( + vertical: 10.0, horizontal: 8.0), + child: Center( + child: Container( + width: 60.0, + foregroundDecoration: BoxDecoration( + borderRadius: BorderRadius.circular(5.0), + border: Border.all( + color: Colors.blueGrey, + width: 2.0, + ), + ), + child: Row( + children: [ + Expanded( + child: Center( + child: Text(height.toString()), + ), + ), + Container( + height: 38.0, + child: Column( + crossAxisAlignment: + CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Container( + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + width: 0.5, + ), + ), + ), + child: InkWell( + child: Icon( + Icons.arrow_drop_up, + size: 18.0, + ), + onTap: () { + setState(() { + if (height < 250) height++; + }); + }, + ), + ), + InkWell( + child: Icon( + Icons.arrow_drop_down, + size: 18.0, + ), + onTap: () { + setState(() { + if (height > 120) height--; + }); + }, + ), + ], + ), + ), + ], + ), + ), + ), + ), + Slider( + value: height.toDouble(), + min: 120, + max: 250, + onChanged: (double newValue) { + setState(() { + height = newValue.round(); + }); + }, + activeColor: Color(0xffC5272D), + inactiveColor: Color(0xffF3C5C6), + ), + ], + ), + Row( + children: [ + Padding( + padding: EdgeInsets.all(8.0), + child: Texts('Select Unit'), + ), + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + GestureDetector( + onTap: () { + setState(() { + updateColor(1); + }); + }, + child: Container( + height: 55.0, + width: 150.0, + decoration: BoxDecoration( + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.5), + spreadRadius: 3, + blurRadius: 7, + offset: + Offset(0, 3), // changes position of shadow + ), + ], + color: cmCard, + borderRadius: BorderRadius.circular(3.0), + ), + child: Padding( + padding: const EdgeInsets.symmetric( + vertical: 0.0, horizontal: 18.0), + child: Center(child: Texts('CM')), + ), + ), + ), + GestureDetector( + onTap: () { + setState(() { + updateColor(2); + }); + }, + child: Container( + height: 55.0, + width: 150.0, + decoration: BoxDecoration( + color: ftCard, + borderRadius: BorderRadius.circular(3.0), + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.5), + spreadRadius: 3, + blurRadius: 7, + offset: + Offset(0, 3), // changes position of shadow + ), + ], + ), + child: Padding( + padding: + const EdgeInsets.symmetric(horizontal: 16.0), + child: Center(child: Texts('FT')), + ), + ), + ), + ], + ), + ], + ), + ), + SizedBox( + height: 25.0, + ), + Container( + height: 200.0, + width: 350.0, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(12.0), + ), + child: Column( + children: [ + Row( + children: [ + Padding( + padding: EdgeInsets.all(8.0), + child: Texts('Weight'), + ), + ], + ), + Row( + children: [ + Padding( + padding: EdgeInsets.symmetric( + vertical: 10.0, horizontal: 8.0), + child: Center( + child: Container( + width: 60.0, + foregroundDecoration: BoxDecoration( + borderRadius: BorderRadius.circular(5.0), + border: Border.all( + color: Colors.blueGrey, + width: 2.0, + ), + ), + child: Row( + children: [ + Expanded( + child: Center( + child: Text(weight.toString()), + ), + ), + Container( + height: 38.0, + child: Column( + crossAxisAlignment: + CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Container( + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + width: 0.5, + ), + ), + ), + child: InkWell( + child: Icon( + Icons.arrow_drop_up, + size: 18.0, + ), + onTap: () { + setState(() { + if (weight < 250) weight++; + }); + }, + ), + ), + InkWell( + child: Icon( + Icons.arrow_drop_down, + size: 18.0, + ), + onTap: () { + setState(() { + if (weight > 40) weight--; + }); + }, + ), + ], + ), + ), + ], + ), + ), + ), + ), + Slider( + value: weight.toDouble(), + min: 40, + max: 250, + onChanged: (double newValue) { + setState(() { + weight = newValue.round(); + }); + }, + activeColor: Color(0xffC5272D), + inactiveColor: Color(0xffF3C5C6), + ), + ], + ), + Row( + children: [ + Padding( + padding: EdgeInsets.all(8.0), + child: Texts('Select Unit'), + ), + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + GestureDetector( + onTap: () { + setState(() { + updateColorWeight(1); + }); + }, + child: Container( + height: 55.0, + width: 150.0, + decoration: BoxDecoration( + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.5), + spreadRadius: 3, + blurRadius: 7, + offset: + Offset(0, 3), // changes position of shadow + ), + ], + color: kgCard, + borderRadius: BorderRadius.circular(3.0), + ), + child: Padding( + padding: const EdgeInsets.symmetric( + vertical: 0.0, horizontal: 18.0), + child: Center(child: Texts('KG')), + ), + ), + ), + GestureDetector( + onTap: () { + setState(() { + updateColorWeight(2); + }); + }, + child: Container( + height: 55.0, + width: 150.0, + decoration: BoxDecoration( + color: lbCard, + borderRadius: BorderRadius.circular(3.0), + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.5), + spreadRadius: 3, + blurRadius: 7, + offset: + Offset(0, 3), // changes position of shadow + ), + ], + ), + child: Padding( + padding: + const EdgeInsets.symmetric(horizontal: 16.0), + child: Center(child: Texts('LB')), + ), + ), + ), + ], + ), + ], + ), + ), + SizedBox( + height: 25.0, + ), + Container( + height: 100.0, + width: 350.0, + child: Button( + label: 'CALCULATE', + onTap: () { + setState(() { + calculateBMI(); + showTextResult(); + showMsg(); + { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => ResultPage( + finalResult: bmiResult, + textResult: textResult, + msg: msg, + )), + ); + } + }); + }, + ), + ), + ], + ), + ), + ); + } +} diff --git a/lib/pages/AlHabibMedicalService/health_calculator/bmi_calculator/result_page.dart b/lib/pages/AlHabibMedicalService/health_calculator/bmi_calculator/result_page.dart new file mode 100644 index 00000000..bfbd10b7 --- /dev/null +++ b/lib/pages/AlHabibMedicalService/health_calculator/bmi_calculator/result_page.dart @@ -0,0 +1,101 @@ +import 'dart:ffi'; + +import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:percent_indicator/percent_indicator.dart'; + +class ResultPage extends StatelessWidget { + final double finalResult; + final String textResult; + final String msg; + + ResultPage({this.finalResult, this.textResult, this.msg}); + Color inductorColor; + double percent; + + Color colorInductor() { + if (finalResult >= 30) { + inductorColor = Color(0xffC70D00); + } else if (finalResult < 30 && finalResult >= 25) { + inductorColor = Color(0xffC25400); + } else if (finalResult < 25 && finalResult >= 18.5) { + inductorColor = Color(0xff36D600); + } else if (finalResult < 18.5) { + inductorColor = Color(0xff1BE0EE); + } + return inductorColor; + } + + double percentInductor() { + if (finalResult >= 30) { + percent = 1.0; + } else if (finalResult < 30 && finalResult >= 25) { + percent = 0.73; + } else if (finalResult < 25 && finalResult >= 18.5) { + percent = 0.5; + } else if (finalResult < 18.5) { + percent = 0.25; + } + return percent; + } + + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: true, + appBarTitle: "BMI Calculator", + body: Column( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + SizedBox( + // height: 40.0, + ), + Center( + child: CircularPercentIndicator( + radius: 220.0, + lineWidth: 20.0, + percent: percentInductor(), + center: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + finalResult.toStringAsFixed(1), + style: TextStyle( + fontSize: 18.0, + fontWeight: FontWeight.bold, + ), + ), + SizedBox( + height: 5.0, + ), + Text( + textResult, + style: TextStyle( + fontSize: 16.0, + fontWeight: FontWeight.w600, + ), + ), + ], + ), + progressColor: colorInductor(), + backgroundColor: Colors.white, + ), + ), + Container( + height: 120, + width: 280.0, + child: Texts(msg), + ), + Container( + width: 350, + child: Button( + label: 'See List Of Doctors', + ), + ), + ], + ), + ); + } +} diff --git a/lib/pages/AlHabibMedicalService/health_calculator/bmr_calculator/bmr_calculator.dart b/lib/pages/AlHabibMedicalService/health_calculator/bmr_calculator/bmr_calculator.dart new file mode 100644 index 00000000..05d3d07a --- /dev/null +++ b/lib/pages/AlHabibMedicalService/health_calculator/bmr_calculator/bmr_calculator.dart @@ -0,0 +1,721 @@ +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/bmr_calculator/bmr_result_page.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; +import 'dart:math'; + +const activeCardColorGender = Color(0xffC5272D); +const inactiveCardColorGender = Color(0xffFAFAFd); +const activeCardColor = Color(0xff70777A); +const inactiveCardColor = Color(0xffFAFAFd); + +class BmrCalculator extends StatefulWidget { + @override + _BmrCalculatorState createState() => _BmrCalculatorState(); +} + +class _BmrCalculatorState extends State { + bool isMale = false; + bool isHeightCm = true; + Color maleCard = activeCardColorGender; + Color femaleCard = inactiveCardColorGender; + Color kgCard = activeCardColor; + Color lbCard = inactiveCardColor; + Color cmCard = activeCardColor; + Color ftCard = inactiveCardColor; + int age = 0; + int height = 0; + int weight = 0; + double bmrResult = 0; + String dropdownValue = 'Lighty Active (1-3) days per week'; + double calories = 0; + + void updateColor(int type) { + //MG/DLT card + if (type == 1) { + if (maleCard == inactiveCardColorGender) { + maleCard = activeCardColorGender; + femaleCard = inactiveCardColorGender; + } else { + maleCard = inactiveCardColorGender; + } + } + if (type == 2) { + if (femaleCard == inactiveCardColorGender) { + femaleCard = activeCardColorGender; + maleCard = inactiveCardColorGender; + } else { + femaleCard = inactiveCardColorGender; + } + } + } + + void updateColorHeight(int type) { + //MG/DLT card + if (type == 1) { + if (cmCard == inactiveCardColor) { + cmCard = activeCardColor; + ftCard = inactiveCardColor; + } else { + cmCard = inactiveCardColor; + } + } + if (type == 2) { + if (ftCard == inactiveCardColor) { + ftCard = activeCardColor; + cmCard = inactiveCardColor; + } else { + ftCard = inactiveCardColor; + } + } + } + + void updateColorWeight(int type) { + //MG/DLT card + if (type == 1) { + if (kgCard == inactiveCardColor) { + kgCard = activeCardColor; + lbCard = inactiveCardColor; + } else { + kgCard = inactiveCardColor; + } + } + if (type == 2) { + if (lbCard == inactiveCardColor) { + lbCard = activeCardColor; + kgCard = inactiveCardColor; + } else { + lbCard = inactiveCardColor; + } + } + } + + void calculateBmr() { + if (isMale == true) { + bmrResult = 66.5 + (13.75 * weight) + (5.003 * height) - (6.755 * age); + } else if (isMale == false) { + bmrResult = + 655.0955 + (9.5634 * weight) + (1.850 * height) - (4.676 * age); + } + + bmrResult = bmrResult.roundToDouble(); + } + + void calculateCalories() { + if (dropdownValue == "Almost Inactive(Little or no exercises)") { + calories = bmrResult * 1.2; + } else if (dropdownValue == "Lighty Active (1-3) days per week") { + calories = bmrResult * 1.375; + } else if (dropdownValue == "very Active(6-7) days per week") { + calories = bmrResult * 1.55; + } else if (dropdownValue == "Super Active(very hard exercises)") { + calories = bmrResult * 1.725; + } else if (dropdownValue == "") { + calories = bmrResult * 10.725; + } + } + + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: true, + appBarTitle: 'Bmr Calculator', + body: Padding( + padding: EdgeInsets.symmetric(horizontal: 25.0, vertical: 15.0), + child: SingleChildScrollView( + child: Container( + height: 850, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: EdgeInsets.all(10.0), + child: Texts( + 'Calculates the amount of energy that the person’s body expends in a day'), + ), + Divider( + thickness: 2.0, + ), + SizedBox( + height: 5.0, + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts('Gender'), + SizedBox( + height: 5.0, + ), + Container( + width: 350, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(35.0), + color: Colors.white, + border: Border.all( + color: Colors.black45, + )), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + GestureDetector( + onTap: () { + setState(() { + updateColor(1); + isMale = false; + }); + }, + child: Container( + height: 55.0, + width: 170.0, + decoration: BoxDecoration( + color: maleCard, + borderRadius: BorderRadius.circular(35.0), + ), + child: Center(child: Texts('FEMALE')), + ), + ), + GestureDetector( + onTap: () { + setState(() { + updateColor(2); + isMale = true; + }); + }, + child: Container( + height: 55.0, + width: 170.0, + decoration: BoxDecoration( + color: femaleCard, + borderRadius: BorderRadius.circular(35.0), + ), + child: Center(child: Texts('MALE')), + ), + ), + ], + ), + ), + SizedBox( + height: 5.0, + ), + Texts( + 'The Age ( 11 - 120 ) yrs', + ), + SizedBox( + height: 10.0, + ), + Row( + children: [ + Container( + width: 335.0, + height: 60.0, + decoration: BoxDecoration( + color: Colors.white, + ), + child: Row( + children: [ + Padding( + padding: EdgeInsets.symmetric( + vertical: 10.0, horizontal: 8.0), + child: Center( + child: Container( + width: 60.0, + foregroundDecoration: BoxDecoration( + borderRadius: BorderRadius.circular(5.0), + border: Border.all( + color: Colors.blueGrey, + width: 2.0, + ), + ), + child: Row( + children: [ + Expanded( + child: Center( + child: Text(age.toString()), + ), + ), + Container( + height: 38.0, + child: Column( + crossAxisAlignment: + CrossAxisAlignment.center, + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + Container( + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + width: 0.5, + ), + ), + ), + child: InkWell( + child: Icon( + Icons.arrow_drop_up, + size: 18.0, + ), + onTap: () { + setState(() { + if (age < 120) age++; + }); + }, + ), + ), + InkWell( + child: Icon( + Icons.arrow_drop_down, + size: 18.0, + ), + onTap: () { + setState(() { + if (age > 0) age--; + }); + }, + ), + ], + ), + ), + ], + ), + ), + ), + ), + Expanded( + child: Slider( + value: age.toDouble(), + min: 0, + max: 120, + onChanged: (double newValue) { + setState(() { + age = newValue.round(); + }); + }, + activeColor: Color(0xffC5272D), + inactiveColor: Color(0xffF3C5C6), + ), + ), + ], + ), + ), + ], + ), + Texts( + 'Height', + ), + Row( + children: [ + Container( + width: 335.0, + height: 60.0, + decoration: BoxDecoration( + color: Colors.white, + ), + child: Row( + children: [ + Padding( + padding: EdgeInsets.symmetric( + vertical: 10.0, horizontal: 8.0), + child: Center( + child: Container( + width: 60.0, + foregroundDecoration: BoxDecoration( + borderRadius: BorderRadius.circular(5.0), + border: Border.all( + color: Colors.blueGrey, + width: 2.0, + ), + ), + child: Row( + children: [ + Expanded( + child: Center( + child: Text(height.toString()), + ), + ), + Container( + height: 38.0, + child: Column( + crossAxisAlignment: + CrossAxisAlignment.center, + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + Container( + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + width: 0.5, + ), + ), + ), + child: InkWell( + child: Icon( + Icons.arrow_drop_up, + size: 18.0, + ), + onTap: () { + setState(() { + if (height < 250) + height++; + }); + }, + ), + ), + InkWell( + child: Icon( + Icons.arrow_drop_down, + size: 18.0, + ), + onTap: () { + setState(() { + if (height > 0) height--; + }); + }, + ), + ], + ), + ), + ], + ), + ), + ), + ), + Expanded( + child: Slider( + value: height.toDouble(), + min: 0, + max: 250, + onChanged: (double newValue) { + setState(() { + height = newValue.round(); + }); + }, + activeColor: Color(0xffC5272D), + inactiveColor: Color(0xffF3C5C6), + ), + ), + ], + ), + ), + ], + ), + Texts('Select Unit'), + SizedBox( + height: 5.0, + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + GestureDetector( + onTap: () { + setState(() { + updateColorHeight(1); + isHeightCm = true; + }); + }, + child: Container( + height: 55.0, + width: 150.0, + decoration: BoxDecoration( + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.5), + spreadRadius: 3, + blurRadius: 7, + offset: Offset( + 0, 3), // changes position of shadow + ), + ], + color: cmCard, + borderRadius: BorderRadius.circular(3.0), + ), + child: Padding( + padding: const EdgeInsets.symmetric( + vertical: 0.0, horizontal: 18.0), + child: Center(child: Texts('CM')), + ), + ), + ), + GestureDetector( + onTap: () { + setState(() { + updateColorHeight(2); + isHeightCm = false; + }); + }, + child: Container( + height: 55.0, + width: 150.0, + decoration: BoxDecoration( + color: ftCard, + borderRadius: BorderRadius.circular(3.0), + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.5), + spreadRadius: 3, + blurRadius: 7, + offset: Offset( + 0, 3), // changes position of shadow + ), + ], + ), + child: Padding( + padding: + const EdgeInsets.symmetric(horizontal: 16.0), + child: Center(child: Texts('Ft')), + ), + ), + ), + ], + ), + SizedBox( + height: 5.0, + ), + Texts( + 'Weight', + ), + SizedBox( + height: 5.0, + ), + Row( + children: [ + Container( + width: 335.0, + height: 60.0, + decoration: BoxDecoration( + color: Colors.white, + ), + child: Row( + children: [ + Padding( + padding: EdgeInsets.symmetric( + vertical: 10.0, horizontal: 8.0), + child: Center( + child: Container( + width: 60.0, + foregroundDecoration: BoxDecoration( + borderRadius: BorderRadius.circular(5.0), + border: Border.all( + color: Colors.blueGrey, + width: 2.0, + ), + ), + child: Row( + children: [ + Expanded( + child: Center( + child: Text(weight.toString()), + ), + ), + Container( + height: 38.0, + child: Column( + crossAxisAlignment: + CrossAxisAlignment.center, + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + Container( + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + width: 0.5, + ), + ), + ), + child: InkWell( + child: Icon( + Icons.arrow_drop_up, + size: 18.0, + ), + onTap: () { + setState(() { + if (weight < 250) + weight++; + }); + }, + ), + ), + InkWell( + child: Icon( + Icons.arrow_drop_down, + size: 18.0, + ), + onTap: () { + setState(() { + if (weight > 0) weight--; + }); + }, + ), + ], + ), + ), + ], + ), + ), + ), + ), + Expanded( + child: Slider( + value: weight.toDouble(), + min: 0, + max: 250, + onChanged: (double newValue) { + setState(() { + weight = newValue.round(); + }); + }, + activeColor: Color(0xffC5272D), + inactiveColor: Color(0xffF3C5C6), + ), + ), + ], + ), + ), + ], + ), + Texts('Select Unit'), + SizedBox( + height: 5.0, + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + GestureDetector( + onTap: () { + setState(() { + updateColorWeight(1); + }); + }, + child: Container( + height: 55.0, + width: 150.0, + decoration: BoxDecoration( + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.5), + spreadRadius: 3, + blurRadius: 7, + offset: Offset( + 0, 3), // changes position of shadow + ), + ], + color: kgCard, + borderRadius: BorderRadius.circular(3.0), + ), + child: Padding( + padding: const EdgeInsets.symmetric( + vertical: 0.0, horizontal: 18.0), + child: Center(child: Texts('KG')), + ), + ), + ), + GestureDetector( + onTap: () { + setState(() { + updateColorWeight(2); + }); + }, + child: Container( + height: 55.0, + width: 150.0, + decoration: BoxDecoration( + color: lbCard, + borderRadius: BorderRadius.circular(3.0), + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.5), + spreadRadius: 3, + blurRadius: 7, + offset: Offset( + 0, 3), // changes position of shadow + ), + ], + ), + child: Padding( + padding: + const EdgeInsets.symmetric(horizontal: 16.0), + child: Center(child: Texts('LB')), + ), + ), + ), + ], + ), + SizedBox( + height: 45.0, + ), + Divider( + thickness: 2.0, + ), + SizedBox( + height: 5.0, + ), + Texts('Activity level'), + Container( + width: 300, + child: DropdownButton( + value: dropdownValue, + icon: Icon(Icons.arrow_downward), + iconSize: 24, + elevation: 16, + style: TextStyle(color: Colors.black87), + underline: Container( + height: 2, + color: Colors.black54, + ), + onChanged: (String newValue) { + setState(() { + dropdownValue = newValue; + }); + }, + items: [ + 'Almost Inactive(Little or no exercises)', + 'Lighty Active (1-3) days per week', + 'very Active(6-7) days per week', + 'Super Active(very hard exercises)' + ].map>((String value) { + return DropdownMenuItem( + value: value, + child: Text(value), + ); + }).toList(), + ), + ), + SizedBox( + height: 30.0, + ), + Container( + height: 100.0, + width: 350.0, + child: Button( + label: 'CALCULATE', + onTap: () { + setState(() { + calculateBmr(); + calculateCalories(); + + { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => BmrResultPage( + bmrResult: bmrResult, + calories: calories, + )), + ); + } + }); + }, + ), + ), + ], + ), + ], + ), + ), + ), + ), + ); + } +} diff --git a/lib/pages/AlHabibMedicalService/health_calculator/bmr_calculator/bmr_result_page.dart b/lib/pages/AlHabibMedicalService/health_calculator/bmr_calculator/bmr_result_page.dart new file mode 100644 index 00000000..a3fdb5f7 --- /dev/null +++ b/lib/pages/AlHabibMedicalService/health_calculator/bmr_calculator/bmr_result_page.dart @@ -0,0 +1,65 @@ +import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:percent_indicator/circular_percent_indicator.dart'; + +class BmrResultPage extends StatelessWidget { + final double bmrResult; + final double calories; + BmrResultPage({this.bmrResult, this.calories}); + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: true, + appBarTitle: 'BMR Calculator', + body: Column( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + Center( + child: CircularPercentIndicator( + radius: 220.0, + lineWidth: 20.0, + percent: ((this.bmrResult > 3500) ? 100 : this.bmrResult / 3500), + center: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + bmrResult.toStringAsFixed(1), + style: TextStyle( + fontSize: 18.0, + fontWeight: FontWeight.bold, + ), + ), + SizedBox( + height: 5.0, + ), + Text( + 'Calories/Day', + style: TextStyle( + fontSize: 16.0, + fontWeight: FontWeight.w600, + ), + ), + ], + ), + progressColor: Color(0xff3C3939), + ), + ), + Container( + height: 120, + width: 280.0, + child: Texts( + '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.'), + ), + Container( + width: 350, + child: Button( + label: 'See List Of Doctors', + ), + ), + ], + ), + ); + } +} diff --git a/lib/pages/AlHabibMedicalService/health_calculator/body_fat/body_fat.dart b/lib/pages/AlHabibMedicalService/health_calculator/body_fat/body_fat.dart new file mode 100644 index 00000000..4a939b3f --- /dev/null +++ b/lib/pages/AlHabibMedicalService/health_calculator/body_fat/body_fat.dart @@ -0,0 +1,1003 @@ +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/body_fat/body_fat_result_page.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; +import 'dart:math'; + +const activeCardColorGender = Color(0xffC5272D); +const inactiveCardColorGender = Color(0xffFAFAFd); +const activeCardColor = Color(0xff70777A); +const inactiveCardColor = Color(0xffFAFAFd); + +class BodyFat extends StatefulWidget { + @override + _BodyFatState createState() => _BodyFatState(); +} + +class _BodyFatState extends State { + bool isMale = false; + bool isHeightCm = true; + Color maleCard = activeCardColorGender; + Color femaleCard = inactiveCardColorGender; + Color neckCmCard = activeCardColor; + Color neckFtCard = inactiveCardColor; + Color waistCmCard = activeCardColor; + Color waistFtCard = inactiveCardColor; + Color hipCmCard = activeCardColor; + Color hipFtCard = inactiveCardColor; + Color cmCard = activeCardColor; + Color ftCard = inactiveCardColor; + int neck = 10; + int heightCm = 0; + int heightFt = 0; + int hip = 5; + double heightInches; + double minRange; + double maxRange; + double overWeightBy; + int waist = 5; + double bodyFat = 0; + double fat = 0; + String dropdownValue; + double calories = 0; + String textResult = ''; + + void updateColorHeight(int type) { + //MG/DLT card + if (type == 1) { + if (cmCard == inactiveCardColor) { + cmCard = activeCardColor; + ftCard = inactiveCardColor; + } else { + cmCard = inactiveCardColor; + } + } + if (type == 2) { + if (ftCard == inactiveCardColor) { + ftCard = activeCardColor; + cmCard = inactiveCardColor; + } else { + ftCard = inactiveCardColor; + } + } + } + + void updateColorNeck(int type) { + //MG/DLT card + if (type == 1) { + if (neckCmCard == inactiveCardColor) { + neckCmCard = activeCardColor; + neckFtCard = inactiveCardColor; + } else { + neckCmCard = inactiveCardColor; + } + } + if (type == 2) { + if (neckFtCard == inactiveCardColor) { + neckFtCard = activeCardColor; + neckCmCard = inactiveCardColor; + } else { + neckFtCard = inactiveCardColor; + } + } + } + + void updateColorWaist(int type) { + //MG/DLT card + if (type == 1) { + if (waistCmCard == inactiveCardColor) { + waistCmCard = activeCardColor; + waistFtCard = inactiveCardColor; + } else { + waistCmCard = inactiveCardColor; + } + } + if (type == 2) { + if (waistFtCard == inactiveCardColor) { + waistFtCard = activeCardColor; + waistCmCard = inactiveCardColor; + } else { + waistFtCard = inactiveCardColor; + } + } + } + + void updateColorHip(int type) { + //MG/DLT card + if (type == 1) { + if (hipCmCard == inactiveCardColor) { + hipCmCard = activeCardColor; + hipFtCard = inactiveCardColor; + } else { + hipCmCard = inactiveCardColor; + } + } + if (type == 2) { + if (hipFtCard == inactiveCardColor) { + hipFtCard = activeCardColor; + hipCmCard = inactiveCardColor; + } else { + hipFtCard = inactiveCardColor; + } + } + } + + void updateColor(int type) { + //MG/DLT card + if (type == 1) { + if (maleCard == inactiveCardColorGender) { + maleCard = activeCardColorGender; + femaleCard = inactiveCardColorGender; + } else { + maleCard = inactiveCardColorGender; + } + } + if (type == 2) { + if (femaleCard == inactiveCardColorGender) { + femaleCard = activeCardColorGender; + maleCard = inactiveCardColorGender; + } else { + femaleCard = inactiveCardColorGender; + } + } + } + + void calculateBodyFat() { + if (isMale == true) { + bodyFat = 495 / + (1.0324 - + 0.19077 * (log(waist - neck) / ln10) + + 0.15456 * (log(heightCm) / ln10)) - + 450; + fat = (bodyFat * 10) / 10.round(); + } else if (isMale == false) { + bodyFat = 495 / + (1.29579 - + 0.35004 * (log(waist + hip - neck) / ln10) + + 0.22100 * (log(heightCm) / ln10)) - + 450; + fat = (bodyFat * 10) / 10.round(); + } + if (fat <= 0) { + fat = 0; + } + } + + void showTextResult() { + if (isMale == false) { + if (bodyFat > 9 && bodyFat <= 13) { + textResult = 'The category falls under essential'; + } else if (bodyFat > 13 && bodyFat <= 20) { + textResult = 'The category falls under athlete'; + } else if (bodyFat > 20 && bodyFat <= 24) { + textResult = 'The category falls under fitness'; + } else if (bodyFat > 24 && bodyFat <= 31) { + textResult = 'The category falls under acceptable'; + } else if (bodyFat > 31 && bodyFat <= 60) { + textResult = 'The category falls under obese'; + } else if (bodyFat > 60) { + textResult = + 'Please check the value you have entered, since the body fat percentage has crosed the limits.'; + } else if (bodyFat <= 9) { + textResult = + 'Please check the value you have entered, since the body fat percentage cannot be this low.'; + } + } else { + if (bodyFat > 5 && fat <= 13) { + textResult = 'The category falls under essential'; + } else if (bodyFat > 13 && bodyFat <= 17) { + textResult = 'The category falls under athlete'; + } else if (bodyFat > 17 && bodyFat <= 24) { + textResult = 'The category falls under fitness'; + } else if (bodyFat > 24 && bodyFat <= 45) { + textResult = 'The category falls under obese'; + } else if (bodyFat > 45) { + textResult = + 'Please check the value you have entered, since the body fat percentage has crosed the limits.'; + } else if (bodyFat <= 5) { + textResult = + 'Please check the value you have entered, since the body fat percentage cannot be this low.'; + } + } + } + + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: true, + appBarTitle: 'Body Fat', + body: Padding( + padding: EdgeInsets.symmetric(horizontal: 25.0, vertical: 15.0), + child: SingleChildScrollView( + child: Container( + height: 1000.0, + child: Column( + children: [ + Padding( + padding: EdgeInsets.all(10.0), + child: + Texts('Estimates the total body fat based on\n the size'), + ), + Divider( + thickness: 2.0, + ), + SizedBox( + height: 5.0, + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts('Gender'), + SizedBox( + height: 5.0, + ), + Container( + width: 350, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(35.0), + color: Colors.white, + border: Border.all( + color: Colors.black45, + )), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + GestureDetector( + onTap: () { + setState(() { + updateColor(1); + isMale = false; + }); + }, + child: Container( + height: 55.0, + width: 170.0, + decoration: BoxDecoration( + color: maleCard, + borderRadius: BorderRadius.circular(35.0), + ), + child: Center(child: Texts('FEMALE')), + ), + ), + GestureDetector( + onTap: () { + setState(() { + updateColor(2); + isMale = true; + }); + }, + child: Container( + height: 55.0, + width: 170.0, + decoration: BoxDecoration( + color: femaleCard, + borderRadius: BorderRadius.circular(35.0), + ), + child: Center(child: Texts('MALE')), + ), + ), + ], + ), + ), + Texts( + 'Height', + ), + Row( + children: [ + Container( + width: 335.0, + height: 60.0, + decoration: BoxDecoration( + color: Colors.white, + ), + child: Row( + children: [ + Padding( + padding: EdgeInsets.symmetric( + vertical: 10.0, horizontal: 8.0), + child: Center( + child: Container( + width: 60.0, + foregroundDecoration: BoxDecoration( + borderRadius: BorderRadius.circular(5.0), + border: Border.all( + color: Colors.blueGrey, + width: 2.0, + ), + ), + child: Row( + children: [ + Expanded( + child: Center( + child: Text(heightCm.toString()), + ), + ), + Container( + height: 38.0, + child: Column( + crossAxisAlignment: + CrossAxisAlignment.center, + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + Container( + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + width: 0.5, + ), + ), + ), + child: InkWell( + child: Icon( + Icons.arrow_drop_up, + size: 18.0, + ), + onTap: () { + setState(() { + if (heightCm < 250) + heightCm++; + }); + }, + ), + ), + InkWell( + child: Icon( + Icons.arrow_drop_down, + size: 18.0, + ), + onTap: () { + setState(() { + if (heightCm > 0) + heightCm--; + }); + }, + ), + ], + ), + ), + ], + ), + ), + ), + ), + Expanded( + child: Slider( + value: heightCm.toDouble(), + min: 0, + max: 250, + onChanged: (double newValue) { + setState(() { + heightCm = newValue.round(); + }); + }, + activeColor: Color(0xffC5272D), + inactiveColor: Color(0xffF3C5C6), + ), + ), + ], + ), + ), + ], + ), + Texts('Select Unit'), + SizedBox( + height: 5.0, + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + GestureDetector( + onTap: () { + setState(() { + updateColorHeight(1); + isHeightCm = true; + }); + }, + child: Container( + height: 55.0, + width: 150.0, + decoration: BoxDecoration( + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.5), + spreadRadius: 3, + blurRadius: 7, + offset: Offset( + 0, 3), // changes position of shadow + ), + ], + color: cmCard, + borderRadius: BorderRadius.circular(3.0), + ), + child: Padding( + padding: const EdgeInsets.symmetric( + vertical: 0.0, horizontal: 18.0), + child: Center(child: Texts('CM')), + ), + ), + ), + GestureDetector( + onTap: () { + setState(() { + updateColorHeight(2); + isHeightCm = false; + }); + }, + child: Container( + height: 55.0, + width: 150.0, + decoration: BoxDecoration( + color: ftCard, + borderRadius: BorderRadius.circular(3.0), + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.5), + spreadRadius: 3, + blurRadius: 7, + offset: Offset( + 0, 3), // changes position of shadow + ), + ], + ), + child: Padding( + padding: + const EdgeInsets.symmetric(horizontal: 16.0), + child: Center(child: Texts('Ft')), + ), + ), + ), + ], + ), + SizedBox( + height: 10.0, + ), + Texts( + 'Neck', + ), + Row( + children: [ + Container( + width: 335.0, + height: 60.0, + decoration: BoxDecoration( + color: Colors.white, + ), + child: Row( + children: [ + Padding( + padding: EdgeInsets.symmetric( + vertical: 10.0, horizontal: 8.0), + child: Center( + child: Container( + width: 60.0, + foregroundDecoration: BoxDecoration( + borderRadius: BorderRadius.circular(5.0), + border: Border.all( + color: Colors.blueGrey, + width: 2.0, + ), + ), + child: Row( + children: [ + Expanded( + child: Center( + child: Text(neck.toString()), + ), + ), + Container( + height: 38.0, + child: Column( + crossAxisAlignment: + CrossAxisAlignment.center, + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + Container( + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + width: 0.5, + ), + ), + ), + child: InkWell( + child: Icon( + Icons.arrow_drop_up, + size: 18.0, + ), + onTap: () { + setState(() { + if (neck < 60) neck++; + }); + }, + ), + ), + InkWell( + child: Icon( + Icons.arrow_drop_down, + size: 18.0, + ), + onTap: () { + setState(() { + if (neck > 5) neck--; + }); + }, + ), + ], + ), + ), + ], + ), + ), + ), + ), + Expanded( + child: Slider( + value: neck.toDouble(), + min: 5, + max: 60, + onChanged: (double newValue) { + setState(() { + neck = newValue.round(); + }); + }, + activeColor: Color(0xffC5272D), + inactiveColor: Color(0xffF3C5C6), + ), + ), + ], + ), + ), + ], + ), + Texts('Select Unit'), + SizedBox( + height: 5.0, + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + GestureDetector( + onTap: () { + setState(() { + updateColorNeck(1); + isHeightCm = true; + }); + }, + child: Container( + height: 55.0, + width: 150.0, + decoration: BoxDecoration( + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.5), + spreadRadius: 3, + blurRadius: 7, + offset: Offset( + 0, 3), // changes position of shadow + ), + ], + color: neckCmCard, + borderRadius: BorderRadius.circular(3.0), + ), + child: Padding( + padding: const EdgeInsets.symmetric( + vertical: 0.0, horizontal: 18.0), + child: Center(child: Texts('CM')), + ), + ), + ), + GestureDetector( + onTap: () { + setState(() { + updateColorNeck(2); + isHeightCm = false; + }); + }, + child: Container( + height: 55.0, + width: 150.0, + decoration: BoxDecoration( + color: neckFtCard, + borderRadius: BorderRadius.circular(3.0), + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.5), + spreadRadius: 3, + blurRadius: 7, + offset: Offset( + 0, 3), // changes position of shadow + ), + ], + ), + child: Padding( + padding: + const EdgeInsets.symmetric(horizontal: 16.0), + child: Center(child: Texts('Ft')), + ), + ), + ), + ], + ), + SizedBox( + height: 10.0, + ), + Texts( + 'Waist', + ), + Row( + children: [ + Container( + width: 335.0, + height: 60.0, + decoration: BoxDecoration( + color: Colors.white, + ), + child: Row( + children: [ + Padding( + padding: EdgeInsets.symmetric( + vertical: 10.0, horizontal: 8.0), + child: Center( + child: Container( + width: 60.0, + foregroundDecoration: BoxDecoration( + borderRadius: BorderRadius.circular(5.0), + border: Border.all( + color: Colors.blueGrey, + width: 2.0, + ), + ), + child: Row( + children: [ + Expanded( + child: Center( + child: Text(waist.toString()), + ), + ), + Container( + height: 38.0, + child: Column( + crossAxisAlignment: + CrossAxisAlignment.center, + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + Container( + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + width: 0.5, + ), + ), + ), + child: InkWell( + child: Icon( + Icons.arrow_drop_up, + size: 18.0, + ), + onTap: () { + setState(() { + if (waist < 200) waist++; + }); + }, + ), + ), + InkWell( + child: Icon( + Icons.arrow_drop_down, + size: 18.0, + ), + onTap: () { + setState(() { + if (waist > 5) waist--; + }); + }, + ), + ], + ), + ), + ], + ), + ), + ), + ), + Expanded( + child: Slider( + value: waist.toDouble(), + min: 5, + max: 200, + onChanged: (double newValue) { + setState(() { + waist = newValue.round(); + }); + }, + activeColor: Color(0xffC5272D), + inactiveColor: Color(0xffF3C5C6), + ), + ), + ], + ), + ), + ], + ), + Texts('Select Unit'), + SizedBox( + height: 5.0, + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + GestureDetector( + onTap: () { + setState(() { + updateColorWaist(1); + isHeightCm = true; + }); + }, + child: Container( + height: 55.0, + width: 150.0, + decoration: BoxDecoration( + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.5), + spreadRadius: 3, + blurRadius: 7, + offset: Offset( + 0, 3), // changes position of shadow + ), + ], + color: waistCmCard, + borderRadius: BorderRadius.circular(3.0), + ), + child: Padding( + padding: const EdgeInsets.symmetric( + vertical: 0.0, horizontal: 18.0), + child: Center(child: Texts('CM')), + ), + ), + ), + GestureDetector( + onTap: () { + setState(() { + updateColorWaist(2); + isHeightCm = false; + }); + }, + child: Container( + height: 55.0, + width: 150.0, + decoration: BoxDecoration( + color: waistFtCard, + borderRadius: BorderRadius.circular(3.0), + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.5), + spreadRadius: 3, + blurRadius: 7, + offset: Offset( + 0, 3), // changes position of shadow + ), + ], + ), + child: Padding( + padding: + const EdgeInsets.symmetric(horizontal: 16.0), + child: Center(child: Texts('Ft')), + ), + ), + ), + ], + ), + SizedBox( + height: 10.0, + ), + Texts( + 'Hip', + ), + Row( + children: [ + Container( + width: 335.0, + height: 60.0, + decoration: BoxDecoration( + color: Colors.white, + ), + child: Row( + children: [ + Padding( + padding: EdgeInsets.symmetric( + vertical: 10.0, horizontal: 8.0), + child: Center( + child: Container( + width: 60.0, + foregroundDecoration: BoxDecoration( + borderRadius: BorderRadius.circular(5.0), + border: Border.all( + color: Colors.blueGrey, + width: 2.0, + ), + ), + child: Row( + children: [ + Expanded( + child: Center( + child: Text(hip.toString()), + ), + ), + Container( + height: 38.0, + child: Column( + crossAxisAlignment: + CrossAxisAlignment.center, + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + Container( + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + width: 0.5, + ), + ), + ), + child: InkWell( + child: Icon( + Icons.arrow_drop_up, + size: 18.0, + ), + onTap: () { + setState(() { + if (hip < 140) hip++; + }); + }, + ), + ), + InkWell( + child: Icon( + Icons.arrow_drop_down, + size: 18.0, + ), + onTap: () { + setState(() { + if (hip > 5) hip--; + }); + }, + ), + ], + ), + ), + ], + ), + ), + ), + ), + Expanded( + child: Slider( + value: hip.toDouble(), + min: 5, + max: 140, + onChanged: (double newValue) { + setState(() { + hip = newValue.round(); + }); + }, + activeColor: Color(0xffC5272D), + inactiveColor: Color(0xffF3C5C6), + ), + ), + ], + ), + ), + ], + ), + Texts('Select Unit'), + SizedBox( + height: 5.0, + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + GestureDetector( + onTap: () { + setState(() { + updateColorHip(1); + isHeightCm = true; + }); + }, + child: Container( + height: 55.0, + width: 150.0, + decoration: BoxDecoration( + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.5), + spreadRadius: 3, + blurRadius: 7, + offset: Offset( + 0, 3), // changes position of shadow + ), + ], + color: hipCmCard, + borderRadius: BorderRadius.circular(3.0), + ), + child: Padding( + padding: const EdgeInsets.symmetric( + vertical: 0.0, horizontal: 18.0), + child: Center(child: Texts('CM')), + ), + ), + ), + GestureDetector( + onTap: () { + setState(() { + updateColorHip(2); + isHeightCm = false; + }); + }, + child: Container( + height: 55.0, + width: 150.0, + decoration: BoxDecoration( + color: hipFtCard, + borderRadius: BorderRadius.circular(3.0), + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.5), + spreadRadius: 3, + blurRadius: 7, + offset: Offset( + 0, 3), // changes position of shadow + ), + ], + ), + child: Padding( + padding: + const EdgeInsets.symmetric(horizontal: 16.0), + child: Center(child: Texts('Ft')), + ), + ), + ), + ], + ), + SizedBox( + height: 35.0, + ), + ], + ), + Container( + height: 100.0, + width: 350.0, + child: Button( + label: 'CALCULATE', + onTap: () { + setState(() { + calculateBodyFat(); + showTextResult(); + + { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => FatResult( + bodyFat: bodyFat, + fat: fat, + textResult: textResult, + )), + ); + } + }); + }, + ), + ), + ], + ), + ), + ), + ), + ); + } +} diff --git a/lib/pages/AlHabibMedicalService/health_calculator/body_fat/body_fat_result_page.dart b/lib/pages/AlHabibMedicalService/health_calculator/body_fat/body_fat_result_page.dart new file mode 100644 index 00000000..c8c5476e --- /dev/null +++ b/lib/pages/AlHabibMedicalService/health_calculator/body_fat/body_fat_result_page.dart @@ -0,0 +1,77 @@ +import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:percent_indicator/circular_percent_indicator.dart'; + +class FatResult extends StatelessWidget { + final double bodyFat; + final double fat; + final String textResult; + + FatResult({this.bodyFat, this.fat, this.textResult = ''}); + Color inductorColor; + Color colorInductor() { + if (bodyFat >= 17) { + inductorColor = Color(0xffC70D00); + } else if (bodyFat < 20 && bodyFat >= 24) { + inductorColor = Color(0xffC25400); + } else if (bodyFat < 24 && bodyFat >= 31) { + inductorColor = Color(0xff36D600); + } else if (bodyFat > 45) { + inductorColor = Color(0xff1BE0EE); + } + return inductorColor; + } + + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: true, + appBarTitle: 'Body Fat', + body: Column( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + SizedBox( + // height: 40.0, + ), + Center( + child: CircularPercentIndicator( + radius: 220.0, + lineWidth: 20.0, + percent: ((fat > 70) ? 100 : fat / 100), + center: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + fat.toStringAsFixed(1) + '%', + style: TextStyle( + fontSize: 18.0, + fontWeight: FontWeight.bold, + ), + ), + SizedBox( + height: 5.0, + ), + ], + ), + progressColor: inductorColor, + backgroundColor: Colors.white, + ), + ), + Container( + height: 120, + width: 280.0, + child: Texts(textResult), + ), + Container( + width: 350, + child: Button( + label: 'See List Of Doctors', + ), + ), + ], + ), + ); + } +} diff --git a/lib/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_calculator.dart b/lib/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_calculator.dart new file mode 100644 index 00000000..ac1aacc3 --- /dev/null +++ b/lib/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_calculator.dart @@ -0,0 +1,676 @@ +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_result_page.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; + +const activeCardColorGender = Color(0xffC5272D); +const inactiveCardColorGender = Color(0xffFAFAFd); +const activeCardColor = Color(0xff70777A); +const inactiveCardColor = Color(0xffFAFAFd); + +class CalorieCalculator extends StatefulWidget { + @override + _CalorieCalculatorState createState() => _CalorieCalculatorState(); +} + +class _CalorieCalculatorState extends State { + bool isMale = false; + Color maleCard = activeCardColorGender; + Color femaleCard = inactiveCardColorGender; + Color kgCard = activeCardColor; + Color lbCard = inactiveCardColor; + Color cmCard = activeCardColor; + Color ftCard = inactiveCardColor; + int age = 0; + int height = 0; + int weight = 0; + double calories; + String dropdownValue; + void updateColor(int type) { + //MG/DLT card + if (type == 1) { + if (maleCard == inactiveCardColorGender) { + maleCard = activeCardColorGender; + femaleCard = inactiveCardColorGender; + } else { + maleCard = inactiveCardColorGender; + } + } + if (type == 2) { + if (femaleCard == inactiveCardColorGender) { + femaleCard = activeCardColorGender; + maleCard = inactiveCardColorGender; + } else { + femaleCard = inactiveCardColorGender; + } + } + } + + void updateColorWeight(int type) { + //MG/DLT card + if (type == 1) { + if (kgCard == inactiveCardColor) { + kgCard = activeCardColor; + lbCard = inactiveCardColor; + } else { + kgCard = inactiveCardColor; + } + } + if (type == 2) { + if (lbCard == inactiveCardColor) { + lbCard = activeCardColor; + kgCard = inactiveCardColor; + } else { + lbCard = inactiveCardColor; + } + } + } + + void updateColorHeight(int type) { + //MG/DLT card + if (type == 1) { + if (cmCard == inactiveCardColor) { + cmCard = activeCardColor; + ftCard = inactiveCardColor; + } else { + cmCard = inactiveCardColor; + } + } + if (type == 2) { + if (ftCard == inactiveCardColor) { + ftCard = activeCardColor; + cmCard = inactiveCardColor; + } else { + ftCard = inactiveCardColor; + } + } + } + + void calculateCalories() { + if (isMale == true) { + calories = 66.5 + (13.75 * weight) + (5.003 * height) - (6.755 * age); + } else if (isMale == false) { + calories = + 655.0955 + (9.5634 * weight) + (1.850 * height) - (4.676 * age); + } + } + + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: true, + appBarTitle: 'Calorie Calculator', + body: Padding( + padding: const EdgeInsets.symmetric(horizontal: 25.0, vertical: 15.0), + child: SingleChildScrollView( + child: Container( + height: 890.0, + child: Column( + //mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.all(10.0), + child: Texts( + 'Calculates daily calorie intake based on several factors, like height, weight, age, gender and daily physical activity rate', + ), + ), + Padding( + padding: + EdgeInsets.symmetric(horizontal: 10.0, vertical: 15.0), + child: Texts('Gender'), + ), + Container( + width: 350, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(35.0), + color: Colors.white, + border: Border.all( + color: Colors.black45, + )), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + GestureDetector( + onTap: () { + setState(() { + updateColor(1); + isMale = false; + }); + }, + child: Container( + height: 55.0, + width: 170.0, + decoration: BoxDecoration( + color: maleCard, + borderRadius: BorderRadius.circular(35.0), + ), + child: Center(child: Texts('FEMALE')), + ), + ), + GestureDetector( + onTap: () { + setState(() { + updateColor(2); + isMale = true; + }); + }, + child: Container( + height: 55.0, + width: 170.0, + decoration: BoxDecoration( + color: femaleCard, + borderRadius: BorderRadius.circular(35.0), + ), + child: Center(child: Texts('MALE')), + ), + ), + ], + ), + ), + SizedBox( + height: 15.0, + ), + Texts( + 'The Age ( 11 - 120 ) yrs', + ), + SizedBox( + height: 10.0, + ), + Row( + children: [ + Container( + width: 335.0, + height: 60.0, + decoration: BoxDecoration( + color: Colors.white, + ), + child: Row( + children: [ + Padding( + padding: EdgeInsets.symmetric( + vertical: 10.0, horizontal: 8.0), + child: Center( + child: Container( + width: 60.0, + foregroundDecoration: BoxDecoration( + borderRadius: BorderRadius.circular(5.0), + border: Border.all( + color: Colors.blueGrey, + width: 2.0, + ), + ), + child: Row( + children: [ + Expanded( + child: Center( + child: Text(age.toString()), + ), + ), + Container( + height: 38.0, + child: Column( + crossAxisAlignment: + CrossAxisAlignment.center, + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + Container( + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + width: 0.5, + ), + ), + ), + child: InkWell( + child: Icon( + Icons.arrow_drop_up, + size: 18.0, + ), + onTap: () { + setState(() { + if (age < 120) age++; + }); + }, + ), + ), + InkWell( + child: Icon( + Icons.arrow_drop_down, + size: 18.0, + ), + onTap: () { + setState(() { + if (age > 0) age--; + }); + }, + ), + ], + ), + ), + ], + ), + ), + ), + ), + Expanded( + child: Slider( + value: age.toDouble(), + min: 0, + max: 120, + onChanged: (double newValue) { + setState(() { + age = newValue.round(); + }); + }, + activeColor: Color(0xffC5272D), + inactiveColor: Color(0xffF3C5C6), + ), + ), + ], + ), + ), + ], + ), + Texts( + 'Height', + ), + Row( + children: [ + Container( + width: 335.0, + height: 60.0, + decoration: BoxDecoration( + color: Colors.white, + ), + child: Row( + children: [ + Padding( + padding: EdgeInsets.symmetric( + vertical: 10.0, horizontal: 8.0), + child: Center( + child: Container( + width: 60.0, + foregroundDecoration: BoxDecoration( + borderRadius: BorderRadius.circular(5.0), + border: Border.all( + color: Colors.blueGrey, + width: 2.0, + ), + ), + child: Row( + children: [ + Expanded( + child: Center( + child: Text(height.toString()), + ), + ), + Container( + height: 38.0, + child: Column( + crossAxisAlignment: + CrossAxisAlignment.center, + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + Container( + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + width: 0.5, + ), + ), + ), + child: InkWell( + child: Icon( + Icons.arrow_drop_up, + size: 18.0, + ), + onTap: () { + setState(() { + if (height < 250) height++; + }); + }, + ), + ), + InkWell( + child: Icon( + Icons.arrow_drop_down, + size: 18.0, + ), + onTap: () { + setState(() { + if (height > 0) height--; + }); + }, + ), + ], + ), + ), + ], + ), + ), + ), + ), + Expanded( + child: Slider( + value: height.toDouble(), + min: 0, + max: 250, + onChanged: (double newValue) { + setState(() { + height = newValue.round(); + }); + }, + activeColor: Color(0xffC5272D), + inactiveColor: Color(0xffF3C5C6), + ), + ), + ], + ), + ), + ], + ), + Texts('Select Unit'), + SizedBox( + height: 5.0, + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + GestureDetector( + onTap: () { + setState(() { + updateColorHeight(1); + }); + }, + child: Container( + height: 55.0, + width: 150.0, + decoration: BoxDecoration( + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.5), + spreadRadius: 3, + blurRadius: 7, + offset: + Offset(0, 3), // changes position of shadow + ), + ], + color: cmCard, + borderRadius: BorderRadius.circular(3.0), + ), + child: Padding( + padding: const EdgeInsets.symmetric( + vertical: 0.0, horizontal: 18.0), + child: Center(child: Texts('CM')), + ), + ), + ), + GestureDetector( + onTap: () { + setState(() { + updateColorHeight(2); + }); + }, + child: Container( + height: 55.0, + width: 150.0, + decoration: BoxDecoration( + color: ftCard, + borderRadius: BorderRadius.circular(3.0), + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.5), + spreadRadius: 3, + blurRadius: 7, + offset: + Offset(0, 3), // changes position of shadow + ), + ], + ), + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 16.0), + child: Center(child: Texts('Ft')), + ), + ), + ), + ], + ), + SizedBox( + height: 5.0, + ), + Texts( + 'Weight', + ), + Row( + children: [ + Container( + width: 335.0, + height: 60.0, + decoration: BoxDecoration( + color: Colors.white, + ), + child: Row( + children: [ + Padding( + padding: EdgeInsets.symmetric( + vertical: 10.0, horizontal: 8.0), + child: Center( + child: Container( + width: 60.0, + foregroundDecoration: BoxDecoration( + borderRadius: BorderRadius.circular(5.0), + border: Border.all( + color: Colors.blueGrey, + width: 2.0, + ), + ), + child: Row( + children: [ + Expanded( + child: Center( + child: Text(weight.toString()), + ), + ), + Container( + height: 38.0, + child: Column( + crossAxisAlignment: + CrossAxisAlignment.center, + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + Container( + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + width: 0.5, + ), + ), + ), + child: InkWell( + child: Icon( + Icons.arrow_drop_up, + size: 18.0, + ), + onTap: () { + setState(() { + if (weight < 250) weight++; + }); + }, + ), + ), + InkWell( + child: Icon( + Icons.arrow_drop_down, + size: 18.0, + ), + onTap: () { + setState(() { + if (weight > 0) weight--; + }); + }, + ), + ], + ), + ), + ], + ), + ), + ), + ), + Expanded( + child: Slider( + value: weight.toDouble(), + min: 0, + max: 250, + onChanged: (double newValue) { + setState(() { + weight = newValue.round(); + }); + }, + activeColor: Color(0xffC5272D), + inactiveColor: Color(0xffF3C5C6), + ), + ), + ], + ), + ), + ], + ), + Texts('Select Unit'), + SizedBox( + height: 5.0, + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + GestureDetector( + onTap: () { + setState(() { + updateColorWeight(1); + }); + }, + child: Container( + height: 55.0, + width: 150.0, + decoration: BoxDecoration( + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.5), + spreadRadius: 3, + blurRadius: 7, + offset: + Offset(0, 3), // changes position of shadow + ), + ], + color: kgCard, + borderRadius: BorderRadius.circular(3.0), + ), + child: Padding( + padding: const EdgeInsets.symmetric( + vertical: 0.0, horizontal: 18.0), + child: Center(child: Texts('KG')), + ), + ), + ), + GestureDetector( + onTap: () { + setState(() { + updateColorWeight(2); + }); + }, + child: Container( + height: 55.0, + width: 150.0, + decoration: BoxDecoration( + color: lbCard, + borderRadius: BorderRadius.circular(3.0), + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.5), + spreadRadius: 3, + blurRadius: 7, + offset: + Offset(0, 3), // changes position of shadow + ), + ], + ), + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 16.0), + child: Center(child: Texts('LB')), + ), + ), + ), + ], + ), + SizedBox( + height: 5.0, + ), + Texts('Activity level'), + Container( + width: 300, + child: DropdownButton( + value: dropdownValue, + icon: Icon(Icons.arrow_downward), + iconSize: 24, + elevation: 16, + style: TextStyle(color: Colors.black87), + underline: Container( + height: 2, + color: Colors.black54, + ), + onChanged: (String newValue) { + setState(() { + dropdownValue = newValue; + }); + }, + items: [ + 'Almost Inactive(Little or no exercises)', + 'Lighty Active (1-3) days per week', + 'very Active(6-7) days per week', + 'Super Active(very hard exercises)' + ].map>((String value) { + return DropdownMenuItem( + value: value, + child: Text(value), + ); + }).toList(), + ), + ), + SizedBox( + height: 25.0, + ), + Container( + height: 100.0, + width: 350.0, + child: Button( + label: 'CALCULATE', + onTap: () { + setState(() { + calculateCalories(); + print(calories); + { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => CalorieResultPage( + calorie: calories, + )), + ); + } + }); + }, + ), + ), + ], + ), + ), + ), + ), + ); + } +} diff --git a/lib/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_result_page.dart b/lib/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_result_page.dart new file mode 100644 index 00000000..5c52ecb0 --- /dev/null +++ b/lib/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_result_page.dart @@ -0,0 +1,59 @@ +import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:percent_indicator/circular_percent_indicator.dart'; + +class CalorieResultPage extends StatelessWidget { + final double calorie; + + CalorieResultPage({this.calorie}); + + @override + Widget build(BuildContext context) { + return AppScaffold( + appBarTitle: 'Calorie Calculator', + isShowAppBar: true, + body: Column( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + Center( + child: CircularPercentIndicator( + radius: 220.0, + lineWidth: 20.0, + percent: ((this.calorie > 3500) ? 100 : this.calorie / 3500), + center: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + calorie.toStringAsFixed(1), + style: TextStyle( + fontSize: 18.0, + fontWeight: FontWeight.bold, + ), + ), + SizedBox( + height: 5.0, + ), + Texts('Calories'), + ], + ), + progressColor: Color(0xff3C3939), + backgroundColor: Colors.white, + ), + ), + Container( + child: + Texts('Daily intake is ${calorie.toStringAsFixed(1)} calories'), + ), + Container( + width: 350, + child: Button( + label: 'See List Of Doctors', + ), + ), + ], + ), + ); + } +} diff --git a/lib/pages/AlHabibMedicalService/health_calculator/carbs/carbs.dart b/lib/pages/AlHabibMedicalService/health_calculator/carbs/carbs.dart new file mode 100644 index 00000000..32ec9262 --- /dev/null +++ b/lib/pages/AlHabibMedicalService/health_calculator/carbs/carbs.dart @@ -0,0 +1,367 @@ +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_calculator.dart'; +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/carbs/carbs_result_page.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; +import 'dart:math'; + +import 'package:flutter/services.dart'; + +class Carbs extends StatefulWidget { + @override + _CarbsState createState() => _CarbsState(); +} + +class _CarbsState extends State { + TextEditingController textController = new TextEditingController(); + int calories; + String dropdownValue; + bool _visible = false; + int meals; + int protein; + int carbs; + + int fat; + double pCal; + double cCal; + double fCal; + double pCalGram; + double cCalGram; + double fCalGram; + double pCalMeal; + double cCalMeal; + double fCalMeal; + + void calculateDietRatios() { + if (dropdownValue == 'Very Low Carb') { + meals = 3; + protein = 45; + carbs = 10; + fat = 45; + } else if (dropdownValue == 'Low Carb') { + meals = 3; + protein = 40; + carbs = 30; + fat = 30; + } else if (dropdownValue == 'Moderate Carb') { + meals = 3; + protein = 25; + carbs = 50; + fat = 25; + } else if (dropdownValue == 'USDA Gudilines') { + meals = 3; + protein = 15; + carbs = 55; + fat = 30; + } else if (dropdownValue == 'Zone Diet') { + meals = 3; + protein = 30; + carbs = 40; + fat = 30; + } + } + + void calculate() { + pCal = (protein / 100.0) * int.parse(textController.text).ceil(); + cCal = (carbs / 100.0) * int.parse(textController.text); + ; + fCal = (fat / 100) * int.parse(textController.text); + ; + pCalGram = pCal / 4.0; + cCalGram = cCal / 4.0; + fCalGram = fCal / 9.0; + pCalMeal = pCalGram / meals.ceil(); + cCalMeal = cCalGram / meals.ceil(); + fCalMeal = fCalGram / meals.ceil(); + } + + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: true, + appBarTitle: 'Carb Protein Fat', + body: Padding( + padding: EdgeInsets.symmetric(horizontal: 25.0, vertical: 15.0), + child: SingleChildScrollView( + child: Container( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + 'Calculates carbohydrate protein and fat\n ratio in calories and grams according to a\n pre-set ratio', + ), + SizedBox( + height: 15.0, + ), + Column( + children: [ + Container( + width: 335.0, + height: 60.0, + decoration: BoxDecoration( + color: Colors.white, + ), + child: Row( + children: [ + Padding( + padding: EdgeInsets.symmetric( + vertical: 10.0, horizontal: 8.0), + child: Center( + child: Container( + width: 300.0, + foregroundDecoration: BoxDecoration( + borderRadius: BorderRadius.circular(5.0), + border: Border.all( + color: Colors.blueGrey, + width: 2.0, + ), + ), + child: Row( + children: [ + Expanded( + child: Center( + child: TextFormField( + controller: textController, + inputFormatters: [ + FilteringTextInputFormatter + .digitsOnly + ], + keyboardType: TextInputType.number, + decoration: InputDecoration( + hintText: " The Calories per day ", + labelStyle: TextStyle( + color: Colors.black87, + ), + ), + ), + ), + ), + Container( + height: 38.0, + child: Column( + crossAxisAlignment: + CrossAxisAlignment.center, + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + Container( + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + width: 0.5, + ), + ), + ), + child: InkWell( + child: Icon( + Icons.arrow_drop_up, + size: 18.0, + ), + onTap: () { + setState(() { + int currentValue = int.parse( + textController.text); + currentValue++; + textController.text = + (currentValue).toString(); + }); + }, + ), + ), + InkWell( + child: Icon( + Icons.arrow_drop_down, + size: 18.0, + ), + onTap: () { + setState(() { + int currentValue = int.parse( + textController.text); + currentValue--; + textController.text = + (currentValue).toString(); + }); + }, + ), + ], + ), + ), + ], + ), + ), + ), + ), + ], + ), + ), + SizedBox( + height: 20.0, + ), + Button( + backgroundColor: Color(0xffC5272D), + label: 'NOT SURE? CLICK HERE ', + onTap: () { + setState(() { + { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => CalorieCalculator()), + ); + } + }); + }, + ), + ], + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts('Select Diet Type'), + Container( + width: 400, + child: DropdownButton( + value: dropdownValue, + icon: Icon(Icons.arrow_downward), + iconSize: 24, + elevation: 16, + style: TextStyle(color: Colors.black87), + underline: Container( + height: 2, + color: Colors.black54, + ), + onChanged: (String newValue) { + setState(() { + dropdownValue = newValue; + calculateDietRatios(); + + dropdownValue == null + ? _visible = false + : _visible = true; + }); + }, + items: [ + 'Very Low Carb', + 'Low Carb', + 'Moderate Carb', + 'USDA Gudilines', + 'Zone Diet', + ].map>((String value) { + return DropdownMenuItem( + value: value, + child: Text(value), + ); + }).toList(), + ), + ), + Visibility( + visible: _visible, + child: Container( + height: 170.0, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + Texts( + 'Ratios are divided according to the selected diet'), + RichText( + text: TextSpan( + style: TextStyle(color: Colors.black), + children: [ + TextSpan(text: 'Meals Per Day '), + TextSpan( + text: '$meals', + style: TextStyle(color: Color(0xffC5272D)), + ), + ], + ), + ), + RichText( + text: TextSpan( + style: TextStyle(color: Colors.black), + children: [ + TextSpan( + text: 'Protein ', + ), + TextSpan( + text: '$protein%', + style: TextStyle(color: Color(0xffC5272D)), + ) + ], + ), + ), + RichText( + text: TextSpan( + style: TextStyle(color: Colors.black), + children: [ + TextSpan( + text: 'Carbohydrate ', + ), + TextSpan( + text: '$carbs%', + style: TextStyle(color: Color(0xffC5272D)), + ) + ], + ), + ), + RichText( + text: TextSpan( + style: TextStyle(color: Colors.black), + children: [ + TextSpan( + text: 'Fat ', + ), + TextSpan( + text: '$fat%', + style: TextStyle(color: Color(0xffC5272D)), + ) + ], + ), + ), + ], + ), + ), + ) + ], + ), + SizedBox( + height: 55.0, + ), + Container( + height: 100.0, + width: 350.0, + child: Button( + label: 'CALCULATE', + onTap: () { + setState(() { + { + calculate(); + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => CarbsResult( + cCal: cCal, + pCal: pCal, + fCal: fCal, + pCalGram: pCalGram, + pCalMeal: pCalMeal, + fCalGram: fCalGram, + fCalMeal: fCalMeal, + cCalGram: cCalGram, + cCalMeal: cCalMeal, + )), + ); + } + }); + }, + ), + ), + ], + ), + ), + ), + ), + ); + } +} diff --git a/lib/pages/AlHabibMedicalService/health_calculator/carbs/carbs_result_page.dart b/lib/pages/AlHabibMedicalService/health_calculator/carbs/carbs_result_page.dart new file mode 100644 index 00000000..f8d0815a --- /dev/null +++ b/lib/pages/AlHabibMedicalService/health_calculator/carbs/carbs_result_page.dart @@ -0,0 +1,175 @@ +import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; +import 'dart:math'; + +import 'package:flutter/painting.dart'; + +class CarbsResult extends StatelessWidget { + double pCal; + double cCal; + double fCal; + double pCalGram; + double cCalGram; + double fCalGram; + double pCalMeal; + double cCalMeal; + double fCalMeal; + + CarbsResult( + {this.pCal, + this.cCal, + this.fCal, + this.pCalGram, + this.cCalGram, + this.fCalGram, + this.fCalMeal, + this.cCalMeal, + this.pCalMeal}); + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: true, + appBarTitle: 'Carb Protein Fat', + body: Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Padding( + padding: EdgeInsets.symmetric(vertical: 30.0, horizontal: 10.0), + child: Table( + border: TableBorder( + verticalInside: BorderSide(width: 1, color: Colors.black54), + bottom: BorderSide(width: 1, color: Colors.black54), + left: BorderSide(width: 1, color: Colors.black54), + right: BorderSide(width: 1, color: Colors.black54), + top: BorderSide(width: 1, color: Colors.black54), + ), + children: [ + TableRow( + decoration: BoxDecoration( + color: Colors.white, + ), + children: [ + TableCell( + child: Center( + child: Texts('Description'), + ), + ), + TableCell( + child: Center( + child: Texts('Protein'), + ), + ), + TableCell( + child: Center( + child: Texts( + 'Carbohydrate', + ), + ), + ), + TableCell( + child: Center( + child: Texts('Fat'), + ), + ), + ]), + TableRow(children: [ + Padding( + padding: EdgeInsets.all(8.0), + child: TableCell( + child: Center( + child: Texts('Calories\n Per Day'), + ), + ), + ), + TableCell( + child: Center( + child: Texts(pCal.ceil().toString() + ' Cals'), + ), + ), + TableCell( + child: Center( + child: Texts(cCal.ceil().toString() + ' Cals'), + ), + ), + TableCell( + child: Center( + child: Texts(fCal.ceil().toString() + ' Cals'), + ), + ), + ]), + TableRow(children: [ + Padding( + padding: EdgeInsets.all(8.0), + child: TableCell( + child: Center( + child: Texts('Grams Per\n Day'), + ), + ), + ), + TableCell( + child: Center( + child: Texts(pCalGram.ceil().toString() + ' gr'), + ), + ), + TableCell( + child: Center( + child: Texts(cCalGram.ceil().toString() + ' gr'), + ), + ), + TableCell( + child: Center( + child: Texts(fCalGram.ceil().toString() + ' gr'), + ), + ), + ]), + TableRow(children: [ + Padding( + padding: EdgeInsets.all(8.0), + child: TableCell( + child: Center( + child: Texts('Grams Per\n Meal'), + ), + ), + ), + TableCell( + child: Center( + child: Texts(pCalMeal.ceil().toString() + ' gr'), + ), + ), + TableCell( + child: Center( + child: Texts(cCalMeal.ceil().toString() + ' gr'), + ), + ), + TableCell( + child: Center( + child: Texts(fCalMeal.ceil().toString() + ' gr'), + ), + ), + ]), + ], + ), + ), + Container( + width: 350, + child: Button( + label: 'See List Of Doctors', + ), + ), + ], + ), + + // Texts(pCal.ceil().toString()), + // Texts(cCal.ceil().toString()), + // Texts(fCal.ceil().toString()), + // Texts(pCalGram.ceil().toString()), + // Texts(cCalGram.ceil().toString()), + // Texts(fCalGram.ceil().toString()), + // Texts(pCalMeal.ceil().toString()), + // Texts(cCalMeal.ceil().toString()), + // Texts(fCalMeal.ceil().toString()), + ); + } +} diff --git a/lib/pages/AlHabibMedicalService/health_calculator/ideal_body/ideal_body.dart b/lib/pages/AlHabibMedicalService/health_calculator/ideal_body/ideal_body.dart new file mode 100644 index 00000000..f534416f --- /dev/null +++ b/lib/pages/AlHabibMedicalService/health_calculator/ideal_body/ideal_body.dart @@ -0,0 +1,550 @@ +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/ideal_body/ideal_body_result_page.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; +import 'dart:math'; + +const activeCardColor = Color(0xff70777A); +const inactiveCardColor = Color(0xffFAFAFd); + +class IdealBody extends StatefulWidget { + @override + _IdealBodyState createState() => _IdealBodyState(); +} + +class _IdealBodyState extends State { + bool isMale = false; + bool isHeightCm = true; + + Color kgCard = activeCardColor; + Color lbCard = inactiveCardColor; + Color cmCard = activeCardColor; + Color ftCard = inactiveCardColor; + int age = 0; + int height = 0; + double heightInches; + double minRange; + double maxRange; + double overWeightBy; + int weight = 0; + double idealWeight = 0; + String dropdownValue; + double calories = 0; + String textResult = ''; + double maxIdealWeight; + double heightFeet; + + void updateColorHeight(int type) { + //MG/DLT card + if (type == 1) { + if (cmCard == inactiveCardColor) { + cmCard = activeCardColor; + ftCard = inactiveCardColor; + } else { + cmCard = inactiveCardColor; + } + } + if (type == 2) { + if (ftCard == inactiveCardColor) { + ftCard = activeCardColor; + cmCard = inactiveCardColor; + } else { + ftCard = inactiveCardColor; + } + } + } + + void updateColorWeight(int type) { + //MG/DLT card + if (type == 1) { + if (kgCard == inactiveCardColor) { + kgCard = activeCardColor; + lbCard = inactiveCardColor; + } else { + kgCard = inactiveCardColor; + } + } + if (type == 2) { + if (lbCard == inactiveCardColor) { + lbCard = activeCardColor; + kgCard = inactiveCardColor; + } else { + lbCard = inactiveCardColor; + } + } + } + + void calculateIdealWeight() { + heightInches = height * .39370078740157477; + heightFeet = heightInches / 12; + idealWeight = (50 + 2.3 * (heightInches - 60)); + if (dropdownValue == 'Small(fingers overlap)') { + idealWeight = idealWeight - 10; + } else if (dropdownValue == 'Medium(fingers touch)') { + idealWeight = idealWeight; + } else if (dropdownValue == 'Large(fingers don\'n touch)') { + idealWeight = idealWeight + 10; + } + + maxIdealWeight = (((idealWeight) * 1.1).round() * 100) / 100; + overWeightBy = weight - maxIdealWeight.roundToDouble(); + minRange = ((idealWeight / 1.1) * 10).round() / 10; + maxRange = maxIdealWeight; + idealWeight = idealWeight; + } + + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: true, + appBarTitle: 'Ideal Body Weight', + body: Padding( + padding: EdgeInsets.symmetric(vertical: 15.0, horizontal: 25.0), + child: SingleChildScrollView( + child: Container( + height: 800.0, + child: Column( + children: [ + Padding( + padding: EdgeInsets.all(10.0), + child: Texts( + 'Calculates the ideal body weight based on height, Weight, and Body Size', + ), + ), + Divider( + thickness: 2.0, + ), + SizedBox( + height: 5.0, + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + 'Height', + ), + Row( + children: [ + Container( + width: 335.0, + height: 60.0, + decoration: BoxDecoration( + color: Colors.white, + ), + child: Row( + children: [ + Padding( + padding: EdgeInsets.symmetric( + vertical: 10.0, horizontal: 8.0), + child: Center( + child: Container( + width: 60.0, + foregroundDecoration: BoxDecoration( + borderRadius: BorderRadius.circular(5.0), + border: Border.all( + color: Colors.blueGrey, + width: 2.0, + ), + ), + child: Row( + children: [ + Expanded( + child: Center( + child: Text(height.toString()), + ), + ), + Container( + height: 38.0, + child: Column( + crossAxisAlignment: + CrossAxisAlignment.center, + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + Container( + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + width: 0.5, + ), + ), + ), + child: InkWell( + child: Icon( + Icons.arrow_drop_up, + size: 18.0, + ), + onTap: () { + setState(() { + if (height < 250) + height++; + }); + }, + ), + ), + InkWell( + child: Icon( + Icons.arrow_drop_down, + size: 18.0, + ), + onTap: () { + setState(() { + if (height > 0) height--; + }); + }, + ), + ], + ), + ), + ], + ), + ), + ), + ), + Expanded( + child: Slider( + value: height.toDouble(), + min: 0, + max: 250, + onChanged: (double newValue) { + setState(() { + height = newValue.round(); + }); + }, + activeColor: Color(0xffC5272D), + inactiveColor: Color(0xffF3C5C6), + ), + ), + ], + ), + ), + ], + ), + Texts('Select Unit'), + SizedBox( + height: 5.0, + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + GestureDetector( + onTap: () { + setState(() { + updateColorHeight(1); + isHeightCm = true; + }); + }, + child: Container( + height: 55.0, + width: 150.0, + decoration: BoxDecoration( + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.5), + spreadRadius: 3, + blurRadius: 7, + offset: Offset( + 0, 3), // changes position of shadow + ), + ], + color: cmCard, + borderRadius: BorderRadius.circular(3.0), + ), + child: Padding( + padding: const EdgeInsets.symmetric( + vertical: 0.0, horizontal: 18.0), + child: Center(child: Texts('CM')), + ), + ), + ), + GestureDetector( + onTap: () { + setState(() { + updateColorHeight(2); + isHeightCm = false; + }); + }, + child: Container( + height: 55.0, + width: 150.0, + decoration: BoxDecoration( + color: ftCard, + borderRadius: BorderRadius.circular(3.0), + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.5), + spreadRadius: 3, + blurRadius: 7, + offset: Offset( + 0, 3), // changes position of shadow + ), + ], + ), + child: Padding( + padding: + const EdgeInsets.symmetric(horizontal: 16.0), + child: Center(child: Texts('Ft')), + ), + ), + ), + ], + ), + SizedBox( + height: 45.0, + ), + Divider( + thickness: 2.0, + ), + Texts( + 'Weight', + ), + SizedBox( + height: 5.0, + ), + Row( + children: [ + Container( + width: 335.0, + height: 60.0, + decoration: BoxDecoration( + color: Colors.white, + ), + child: Row( + children: [ + Padding( + padding: EdgeInsets.symmetric( + vertical: 10.0, horizontal: 8.0), + child: Center( + child: Container( + width: 60.0, + foregroundDecoration: BoxDecoration( + borderRadius: BorderRadius.circular(5.0), + border: Border.all( + color: Colors.blueGrey, + width: 2.0, + ), + ), + child: Row( + children: [ + Expanded( + child: Center( + child: Text(weight.toString()), + ), + ), + Container( + height: 38.0, + child: Column( + crossAxisAlignment: + CrossAxisAlignment.center, + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + Container( + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + width: 0.5, + ), + ), + ), + child: InkWell( + child: Icon( + Icons.arrow_drop_up, + size: 18.0, + ), + onTap: () { + setState(() { + if (weight < 250) + weight++; + }); + }, + ), + ), + InkWell( + child: Icon( + Icons.arrow_drop_down, + size: 18.0, + ), + onTap: () { + setState(() { + if (weight > 0) weight--; + }); + }, + ), + ], + ), + ), + ], + ), + ), + ), + ), + Expanded( + child: Slider( + value: weight.toDouble(), + min: 0, + max: 250, + onChanged: (double newValue) { + setState(() { + weight = newValue.round(); + }); + }, + activeColor: Color(0xffC5272D), + inactiveColor: Color(0xffF3C5C6), + ), + ), + ], + ), + ), + ], + ), + Texts('Select Unit'), + SizedBox( + height: 5.0, + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + GestureDetector( + onTap: () { + setState(() { + updateColorWeight(1); + }); + }, + child: Container( + height: 55.0, + width: 150.0, + decoration: BoxDecoration( + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.5), + spreadRadius: 3, + blurRadius: 7, + offset: Offset( + 0, 3), // changes position of shadow + ), + ], + color: kgCard, + borderRadius: BorderRadius.circular(3.0), + ), + child: Padding( + padding: const EdgeInsets.symmetric( + vertical: 0.0, horizontal: 18.0), + child: Center(child: Texts('KG')), + ), + ), + ), + GestureDetector( + onTap: () { + setState(() { + updateColorWeight(2); + }); + }, + child: Container( + height: 55.0, + width: 150.0, + decoration: BoxDecoration( + color: lbCard, + borderRadius: BorderRadius.circular(3.0), + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.5), + spreadRadius: 3, + blurRadius: 7, + offset: Offset( + 0, 3), // changes position of shadow + ), + ], + ), + child: Padding( + padding: + const EdgeInsets.symmetric(horizontal: 16.0), + child: Center(child: Texts('LB')), + ), + ), + ), + ], + ), + SizedBox( + height: 45.0, + ), + Divider( + thickness: 2.0, + ), + SizedBox( + height: 5.0, + ), + Texts('Body Frame Size'), + Container( + width: 300, + child: DropdownButton( + value: dropdownValue, + icon: Icon(Icons.arrow_downward), + iconSize: 24, + elevation: 16, + style: TextStyle(color: Colors.black87), + underline: Container( + height: 2, + color: Colors.black54, + ), + onChanged: (String newValue) { + setState(() { + dropdownValue = newValue; + }); + }, + items: [ + 'Small(fingers overlap)', + 'Medium(fingers touch)', + 'Large(fingers don\'n touch)', + ].map>((String value) { + return DropdownMenuItem( + value: value, + child: Text(value), + ); + }).toList(), + ), + ), + SizedBox( + height: 30.0, + ), + Container( + height: 100.0, + width: 350.0, + child: Button( + label: 'CALCULATE', + onTap: () { + setState(() { + // calculateBmr(); + // calculateCalories(); + calculateIdealWeight(); + + print(idealWeight); + //print(overWeightBy); + { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => IdealBodyResult( + idealBodyWeight: idealWeight, + minRange: minRange, + mixRange: maxRange, + overWeightBy: overWeightBy, + textResult: textResult, + )), + ); + } + }); + }, + ), + ), + ], + ), + ], + ), + ), + ), + ), + ); + } +} diff --git a/lib/pages/AlHabibMedicalService/health_calculator/ideal_body/ideal_body_result_page.dart b/lib/pages/AlHabibMedicalService/health_calculator/ideal_body/ideal_body_result_page.dart new file mode 100644 index 00000000..605e499a --- /dev/null +++ b/lib/pages/AlHabibMedicalService/health_calculator/ideal_body/ideal_body_result_page.dart @@ -0,0 +1,170 @@ +import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; +import 'dart:math'; + +class IdealBodyResult extends StatelessWidget { + final double idealBodyWeight; + final double minRange; + final double mixRange; + final double overWeightBy; + final String textResult; + + IdealBodyResult( + {this.idealBodyWeight, + this.minRange, + this.mixRange, + this.overWeightBy, + this.textResult}); + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: true, + appBarTitle: 'Ideal Body Weight', + body: Column( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + Texts( + 'Ideal weight range is', + fontSize: 23.0, + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + Row( + children: [ + Texts( + minRange.toStringAsFixed(1), + fontSize: 30.0, + ), + Padding( + padding: EdgeInsets.only(top: 8.0, left: 4.0), + child: Text( + 'Kg', + style: TextStyle(color: Colors.red), + ), + ), + ], + ), + Icon( + Icons.arrow_forward, + color: Colors.red, + size: 55.0, + ), + Row( + children: [ + Texts( + mixRange.toStringAsFixed(1), + fontSize: 30.0, + ), + Padding( + padding: EdgeInsets.only(top: 8.0, left: 4.0), + child: Text( + 'Kg', + style: TextStyle(color: Colors.red), + ), + ), + ], + ), + ], + ), + overWeightBy >= 0 && overWeightBy <= 10 + ? Column( + children: [ + Texts( + 'Congratulations! The current weight is\n perfect and considered healthy', + fontSize: 20.0, + ), + ], + ) + : overWeightBy > 10 && overWeightBy < 17 + ? Column( + children: [ + Texts( + 'This means that the weight is a little bit more than ideal weight by'), + Texts(overWeightBy.toStringAsFixed(1)), + Texts( + 'May wish to consult with the doctor for medical help. Click to view our list of Doctors'), + ], + ) + : overWeightBy >= 18 + ? Container( + height: 250.0, + width: 350, + child: Column( + children: [ + Texts( + 'Means that you suffer from excessive\n obesity by', + ), + SizedBox( + height: 55.0, + ), + Texts( + overWeightBy.toStringAsFixed(1), + fontSize: 40.0, + ), + SizedBox( + height: 25.0, + ), + Texts( + 'May wish to consult with the doctor for\n medical help. Click to view our list of\n Doctors'), + ], + ), + ) + : overWeightBy < -18 + ? Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Texts( + 'Under Weight', + fontSize: 18.0, + ), + ), + SizedBox( + height: 55.0, + ), + Texts( + overWeightBy.toStringAsFixed(1), + fontSize: 20.0, + ), + ], + ) + : Container( + height: 250.0, + width: 350.0, + child: Column( + children: [ + Texts( + 'under wheight', + fontSize: 20.0, + ), + SizedBox( + height: 55.0, + ), + Texts( + overWeightBy.toStringAsFixed(1), + fontSize: 20.0, + ), + SizedBox( + height: 25.0, + ), + Texts( + 'May wish to consult with the doctor for\n medical help. Click to view our list of\n Doctors'), + ], + ), + ), + Container( + width: 350, + child: Button( + label: 'See List Of Doctors', + ), + ), + ], + ), + ); + } +} diff --git a/lib/pages/AlHabibMedicalService/health_converter/blood_cholesterol.dart b/lib/pages/AlHabibMedicalService/health_converter/blood_cholesterol.dart index 7a48cf9b..9a2f08df 100644 --- a/lib/pages/AlHabibMedicalService/health_converter/blood_cholesterol.dart +++ b/lib/pages/AlHabibMedicalService/health_converter/blood_cholesterol.dart @@ -96,7 +96,7 @@ class _BloodCholesterolState extends State { children: [ Texts( 'Convert from', - ) + ), ], ), ), diff --git a/lib/pages/AlHabibMedicalService/​ health_calculators.dart b/lib/pages/AlHabibMedicalService/​ health_calculators.dart new file mode 100644 index 00000000..56fb0428 --- /dev/null +++ b/lib/pages/AlHabibMedicalService/​ health_calculators.dart @@ -0,0 +1,279 @@ +import 'file:///C:/Users/admin/AndroidStudioProjects/diplomatic-quarter/lib/pages/AlHabibMedicalService/health_calculator/bmi_calculator/bmi_calculator.dart'; +import 'file:///C:/Users/admin/AndroidStudioProjects/diplomatic-quarter/lib/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_calculator.dart'; +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/body_fat/body_fat.dart'; +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/carbs/carbs.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/medical/medical_profile_item.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; +import 'package:flutter/material.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; + +import 'health_calculator/bmr_calculator/bmr_calculator.dart'; +import 'health_calculator/ideal_body/ideal_body.dart'; + +class HealthCalculators extends StatefulWidget { + @override + _HealthCalculatorsState createState() => _HealthCalculatorsState(); +} + +class _HealthCalculatorsState extends State + with SingleTickerProviderStateMixin { + TabController _tabController; + void initState() { + super.initState(); + _tabController = TabController(length: 2, vsync: this); + } + + void dispose() { + super.dispose(); + _tabController.dispose(); + } + + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: true, + appBarTitle: 'Health Calculators', + body: Scaffold( + extendBodyBehindAppBar: true, + appBar: PreferredSize( + preferredSize: Size.fromHeight(70.0), + child: Stack( + children: [ + Center( + child: Container( + height: 60.0, + margin: EdgeInsets.only(top: 10.0), + width: MediaQuery.of(context).size.width * 1.9, + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: Theme.of(context).dividerColor, + width: 5.7, + ), + ), + color: Colors.white, + ), + child: Center( + child: TabBar( + controller: _tabController, + isScrollable: true, + indicatorWeight: 4.0, + indicatorColor: Colors.red, + labelColor: Theme.of(context).primaryColor, + labelPadding: + EdgeInsets.symmetric(horizontal: 13.0, vertical: 2.0), + unselectedLabelColor: Colors.grey, + tabs: [ + Container( + width: MediaQuery.of(context).size.width * 0.35, + child: Center( + child: Texts('General Health'), + ), + ), + Container( + width: MediaQuery.of(context).size.width * 0.35, + child: Center( + child: Texts("Women's Health"), + ), + ), + ], + ), + ), + ), + ) + ], + ), + ), + body: Column( + children: [ + Expanded( + child: TabBarView( + physics: BouncingScrollPhysics(), + controller: _tabController, + children: [ + Container( + child: Column( + children: [ + Container( + width: double.infinity, + height: 80, + ), + Row( + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + Navigator.push( + context, + FadePage(page: BMICalculator()), + ); + }, + child: MedicalProfileItem( + title: 'BMI', + imagePath: 'bmi_health_calculator.png', + subTitle: 'Calculators', + ), + ), + ), + Expanded( + flex: 1, + child: InkWell( + onTap: () { + Navigator.push( + context, + FadePage( + page: CalorieCalculator(), + ), + ); + }, + child: MedicalProfileItem( + title: 'Calories', + imagePath: 'calories-calculator.png', + subTitle: 'Calculators', + ), + ), + ), + ], + ), + Row( + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + Navigator.push( + context, + FadePage( + page: BmrCalculator(), + ), + ); + }, + child: MedicalProfileItem( + title: 'BMR', + imagePath: 'BMR_calculator.png', + subTitle: 'Calculators', + ), + ), + ), + Expanded( + flex: 1, + child: InkWell( + onTap: () { + Navigator.push( + context, + FadePage( + page: IdealBody(), + ), + ); + }, + child: MedicalProfileItem( + title: 'Ideal Body', + imagePath: 'body_weight.png', + subTitle: 'Weight', + ), + ), + ), + ], + ), + Row( + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + Navigator.push( + context, + FadePage( + page: BodyFat(), + ), + ); + }, + child: MedicalProfileItem( + title: 'Body', + imagePath: 'body_fat.png', + subTitle: 'Fat', + ), + ), + ), + Expanded( + flex: 1, + child: InkWell( + onTap: () { + Navigator.push( + context, + FadePage( + page: Carbs(), + ), + ); + }, + child: MedicalProfileItem( + title: 'Carbohydrate', + imagePath: 'carb_protein.png', + subTitle: 'Protein Fat', + ), + ), + ), + ], + ), + ], + ), + ), + Container( + child: Column( + children: [ + Container( + width: double.infinity, + height: 80, + ), + Row( + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + // Navigator.push( + // context, + // FadePage(page: BloodSugar()), + // ); + }, + child: MedicalProfileItem( + title: 'Ovulation', + imagePath: 'ovulation_period_icon.png', + subTitle: 'Period', + ), + ), + ), + Expanded( + flex: 1, + child: InkWell( + onTap: () { + // Navigator.push( + // context, + // FadePage( + // page: BloodCholesterol(), + // ), + // ); + }, + child: MedicalProfileItem( + title: 'Delivery', + imagePath: 'delivery_date_icon.png', + subTitle: 'Due Date', + ), + ), + ), + ], + ), + ], + ), + ), + ], + ), + ) + ], + ), + ), + ); + } +} diff --git a/pubspec.yaml b/pubspec.yaml index 9b9588fd..ff2c0a00 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -110,6 +110,9 @@ dependencies: #Popup_window popup_box: ^0.1.0 + #Numbers + number_inc_dec: ^0.6.6 + From 84f429e559dddd4f2c18d7c1c88ec7ce37344683 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Wed, 7 Oct 2020 12:50:08 +0300 Subject: [PATCH 2/2] merge --- .../all_habib_medical_service_page.dart | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart index 5cd92898..bc30626e 100644 --- a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart +++ b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart @@ -220,7 +220,7 @@ class _AllHabibMedicalServiceState extends State { ServicesContainer( onTap: () => Navigator.push( context, - FadePage(page:BloodDonationPage()), + FadePage(page: BloodDonationPage()), ), imageLocation: 'assets/images/new-design/blood_icon.png', title: 'Blood Donation', @@ -288,7 +288,8 @@ class _AllHabibMedicalServiceState extends State { Navigator.of(context).push(MaterialPageRoute( builder: (BuildContext context) => MyWebView( title: "HMG News", - selectedUrl: "https://twitter.com/hashtag/مجموعة_د_سليمان_الحبيب_الطبية?src=hashtag_click&f=live", + selectedUrl: + "https://twitter.com/hashtag/مجموعة_د_سليمان_الحبيب_الطبية?src=hashtag_click&f=live", ))); }, imageLocation: