From eb3d18efa33e891f1e9062f81d2b347380647f8b Mon Sep 17 00:00:00 2001 From: Sneha Date: Thu, 19 Oct 2023 11:45:49 +0530 Subject: [PATCH] cancel button added in image page --- android/app/src/main/AndroidManifest.xml | 2 + images/bmi.png | Bin 0 -> 3175 bytes images/happy.png | Bin 0 -> 2989 bytes images/invitations.png | Bin 5295 -> 1285 bytes images/myconnections.png | Bin 1177 -> 6299 bytes images/ok.png | Bin 0 -> 2634 bytes images/sad.png | Bin 0 -> 3064 bytes lib/BMI/bmi_caluculator.dart | 310 +++-- lib/BMI/bmi_history.dart | 294 +++-- lib/BP/bp_calculator.dart | 135 ++- lib/BP/bp_history.dart | 447 ++++--- lib/Reports/add_reports.dart | 3 +- lib/Reports/all_records_tab.dart | 1 + lib/Sugar/sugar_calculator.dart | 109 +- lib/Sugar/sugar_history.dart | 546 ++++++--- lib/chart/bmi_chart.dart | 2 +- lib/common/dashboard.dart | 27 +- lib/common/settings.dart | 242 +++- lib/common/zoom_image.dart | 40 +- lib/edit_medicine_timings.dart | 404 +++++- lib/howareufeeling_today.dart | 190 ++- lib/invitations/invitations.dart | 4 +- lib/models/all_problems_model.dart | 33 + lib/models/bmi_history_model.dart | 28 +- lib/models/bp_history_model.dart | 22 +- lib/models/sugar_history_model.dart | 22 +- lib/my_health.dart | 118 +- lib/my_medicine_timings.dart | 335 +---- lib/prescriptions/oreder_medicines.dart | 54 +- lib/prescriptions/prescriptions.dart | 12 +- lib/report_my_self.dart | 219 ---- lib/report_problem/all_problems.dart | 1079 +++++++++++++++++ lib/report_problem/audio_file.dart | 59 + lib/report_problem/report_my_self.dart | 783 ++++++++++++ lib/report_problem/video_file.dart | 59 + lib/report_problem/video_recorder.dart | 89 ++ macos/Flutter/GeneratedPluginRegistrant.swift | 8 + pubspec.lock | 255 +++- pubspec.yaml | 27 +- 39 files changed, 4618 insertions(+), 1340 deletions(-) create mode 100644 images/bmi.png create mode 100644 images/happy.png create mode 100644 images/ok.png create mode 100644 images/sad.png create mode 100644 lib/models/all_problems_model.dart delete mode 100644 lib/report_my_self.dart create mode 100644 lib/report_problem/all_problems.dart create mode 100644 lib/report_problem/audio_file.dart create mode 100644 lib/report_problem/report_my_self.dart create mode 100644 lib/report_problem/video_file.dart create mode 100644 lib/report_problem/video_recorder.dart diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 18d328f..dfc92aa 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -12,7 +12,9 @@ + diff --git a/images/bmi.png b/images/bmi.png new file mode 100644 index 0000000000000000000000000000000000000000..5de861a7d44d8d614daf3b5a9e51f607e96ba526 GIT binary patch literal 3175 zcma)9=QkS+ypHvjCT6WRlY6X}uU!TJ0Id3Y+7JGE@c)wepTDZ? zqWBpA0LkcUYnlhs{lee(pVQ@v#{wR#%x+q?S)2;4GFF&!tivVUr3*FoS)|mo zrIc9+8Ilo3|FwY>p%6w-hA`8@YkMaLt7C;^*9HM1%pg4t%Clm!1JB4VN36!5yu!k* zLQX)REa?AR*zYXJ{dYZ6H?c(v#RUG6$Ye@4Egj9rKL*)NZxugOj81xh zjB1z`Odu(;YyA-)pSThfadCFBZK@I@32VF9HS<&#_PNE5VY|Sg&d=3Ju&~9&0fyP5 zMOzcFnh@k?ihveV^{Z~DdQ$9)5+>!5y3qZ1XVkShLQK-->(tFDPW!%ny7L(m(>JTa zZ&dNta~2z;FS%~-r@?ZA2cw8v%ej!9!h!)~#6?wSA%)k0U>6S&3!au|(x2O8SQ3jlLy7@R8}o^mjwg z&}5p|B(4)VWUjN^4D8bW22a9<5y_GCJh2~JUL5`)EZ8z-N?VC0_YdIY{q1Nb76TTO ze7Y?^J3nD!Z#61L<>Fj7kQPRbY`a9b<(V6@DsWz;en7kE+_z0qs?9dY)`FTFGLRax zfOZ#HK(DFht+wY#3sRL^E{mHaydVdCx{*NK3@~z6EO9a5%ZuihP{>O+TUIoG-q-2Q z&=fv2t7OsXgYuc&AeUQu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gdBXyr1i>R5f zopSDxVPVt!tSRYZ#%(sZg}$m2&c@&UygSDN^SMr+JkCDOnLu58>OmU z4VIXrL>(Dx2{pza`3u0>kk|5>d(klfwM@t;{)Vw zn5R2NiMiKNEniMQ%|NfMb6pZbCuG|XR zGw!<3vuve~LKKqMErzgnl&q+yIr3Z7E%Wu5A!RWAlMcCT-;K%~*MSCJdsI|yDi1u$ z!qp76I((G)4qUG{wAQsr>h}EbVnIGB3vh6<7!A%K^;B|&d^(0En!=bXT@?nWThD9k zKC<=};A&z;Y$an0nw@=aG)9ojiALp3tR4on!

+lkw0MwY1iBzU>7A8-SpT4_c%4 zV2$UCRc+quNtlJ^4(11M4{fEn#Z2gm50aRBpq5AoAXL$E+AjrF>tK*rU8lM8Qgp`> zqS1Cr=sunDAO`KEf5{=WEr0M*Ef@<^a(OA`)q%I$D<2AkYi2!QvTq_eh$pHFp(pYT zVY3!83W?4qVD^Fl<#h+w3emmmKJnJKaaxO&8Se)lNmoEgD9e1${HOj!TDIuC&9SUw zI?=#vg`uzG!_nGqDstm5j(ew@D_lZ!#OuHQsTol4s!k4?zgDm;<`vgD*iC51Aoz8 zh?Q3?#@;Pw)pt0bYTc`^n~h$ZGB8uqt-GR}CGR)g3ZYu(zP_Pj8EN1?8x=iKRR14e z!AjBVRXpP2(Y@i&{*C5|t2R&S6p@??XLyO{hWv{ufmd(r{x|LL6l;I>%5r*fKfWqK z2gEyi3l7-f#`^GqRv!2Lu5IWIiFe}vzu>0&hwe%91TaMA`M}=+0npbm(SD6^jQ$@Y Cj2dJB literal 0 HcmV?d00001 diff --git a/images/happy.png b/images/happy.png new file mode 100644 index 0000000000000000000000000000000000000000..124f8980f23ce3e3b5a378f4689aef97309a900a GIT binary patch literal 2989 zcmaKucRUmh1IBf-H)ka4vXU7JC!6GKq2p}TS&V?d|ve|Gs}b&-2Ig{QG=9-vkRYLl#DUMk*>Q7NdLmR)6!wzoMu8>uL{g|D>W~ zLKx}mSiiWmk?(4CwTrVWL|iZ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c2SuHg^)oPX3;r|2Dl`5YA diff --git a/images/myconnections.png b/images/myconnections.png index 51fa9eb3087081c1e4a1670003bfdf4ed7a250c3..00d4f80c536064f1b2e400285748f1c8983dd8e7 100644 GIT binary patch literal 6299 zcmcJT^-~ny*Td9K#G>gKMlu^En=--}zVE@f zy#@1nP^*VtPq`hll@p&R;*3$dPqMTI(VB$*O7J<|=}5E_#SFIQX4l_+JKzFxSXL+e zG`nh~eRv=Ae_G!MZE$}cVUDsK8amx;Fw_8!P^ICK zBF|)L(`O+w$P~x0u0Iv7i$_D=)QZ3un`|c$+^^4)4`a%?7wHjp;U~}~) zPlCTscPE_4HOtcLF4z&Nz08dd)R=3bu(6L40wcO+G}~qDxb|P-k6m~Mw5p6aKYc)1 z{-RI zZ8^oYX&d$`q*h42UuJzj5F1^It*S1Zf|!b`P^a@|ijEfk9&}d*Fi=UNMUi*9 zw4T-h^^gpYeQPP_TaM6mi<4;~w5}D;4t3oxtr2o-342@v##ChIg|U>SA2@<=C}pRS zWd8c%?ZLx!DqKyyxztL@wSrsRXt;TSah>Kj+0)C7#2M%E71Y4U@gK%w(JoZQ@X01y z#M?{M>U8fIo8om`{ZNjn_RWJd%ppM-cL-3)v*a#Lb!3O2l2)$c@@$;#mgc6VbQtr< z5`h@nFD0e>^zOqot1wMA^|zg}$~J9zW%eN^{G^=bTZG*9_Agzc)lq!-ez4G8?Z~zCb0hX&p1=R7aPrxT1O2 zMvwE^`k6th6%h;5%QONYgy*{JH?Zp01(#^W(0yVE0*7Q*Ntmxj1{%_a}geui`wcIHYgD6Kcju9LJ6Jx1FC18+T^&JBw4B% zR*|y$Z%U3K3t!J(4aUXW|g>?hx z>)@|zZt6ruQn-z{bu_(Z`M&xPu{Io4e&PelUD}$!`Ul#n?M$rZQwlc&#yersEa-@* z?U7{MIE#NQAEuyY>Gqd+V*27YLQz{yC!JAKYzMH=$cLaiL zA^}uIdR<&{ZJhDqS|a1E6%A!}e)F_w1!84xNg{UnYC34aOhoA)Oc(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@h)~L7&S}tA+1!L&54&n3T;;E7Jt!-m3`i36#0!ZfOH6 r2ir|PDSUn7Fcuz1J63XgiSG9w&=(|VlTJP%00000NkvXXu0mjf^;#{& diff --git a/images/ok.png b/images/ok.png new file mode 100644 index 0000000000000000000000000000000000000000..57c481939a22ea304fe8dd8182d89594fda2664f GIT binary patch literal 2634 zcmai$`9Bj51IJlgS-E9=ziEk*t8$CTwak!Ma>wM#mT1Lhu7)T^QgY`WIfhJ|<(OQV zk>n0BvWm%F&Yqrs;CX)deBQ6u=cmt)@5i<_aG}Hh9_HiY6GB+PkbjB)Zv+nhZ9Q+D z0Y1LNVhEUtJ)WPJ+j~c*ORTGc@WMkKuqSwBj!T!JVePEAM`G{-@e6X&p#`*m2W1=aN0~{MihA&Pii?g}Tw)w^G-#c*otaek+ z$6eanit>sIego)}uGtm*|9~_x=rMkIamiFR8U&*&^PBQZi!%*QvgJSSo_F;E8b4)3 zp5l{BStnoB*j~E&L1bFo4nuSdkup0>ZZSrjHFf)K-@aJ(K@XXC@4=%Rshr;7+&e&R zatNUMlK+PjQ3^ln%6@byI345{8T_LkEcsRkV1y6G6`YLO5wE=gyV{G8QXDON)}JPY z_n{pJbY5ke1oj#S#8N7m21oPQ-ND)_m!cC21*yWwWjf2$5jmYU8Ft0EfN=JqZKxX3 zVP|`u7ZqRzdi9(MAyg55--iL=i{dLDiYm?x)@nxKO=<)~rHO2Aa!gVm_LqP%%m)Z% z*RSq0HaToDRBvA0OC+%V7-noO@7L5d=55zF=27RPwijuvKr*NVdCf4@H}Ydz;1!N} zTHK^iJk|D2&em@;%IK2L_ma?=sR)goYzV4`94T1W=m@eLzn+n9C3&HO-mPX$-RE)o zyn@)QrO6P7f(luzKfq7Yaq^bm{O`TEUTF5gcyl{zL!|lV^6z0RNW)R$iAMB!phhHS z)WDRVC&wK{%#^vv#u%#cdSR^P@$V*JfgnNG9^&&b->O%-VY~Y-Y3)AEZ%YIf^_vRF zq=;vmKzceJe0rLCNMvt#KmU5zY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gua@g0o- literal 0 HcmV?d00001 diff --git a/images/sad.png b/images/sad.png new file mode 100644 index 0000000000000000000000000000000000000000..2f97b0fe3922fe57cbbf41ccd9c5f26f1773f312 GIT binary patch literal 3064 zcmVHrybS69k_i;slXvt71%yEj~CAyB{o{05}2o!xnh+0XfEiUA1L= z0?Q{bdxD*uU`b*dZP4_Ser6;`NIfsobkB@P|Eg4mnZeTNKTp3rFWmqZi^XEGSS%Kc z#bU8oEEbE!VzF2(7K_DVu~;k?i^XEm1%qou^Ps-?|M_lJ%<#{dz$JOemAB}IXVD$J z78yI|2p$5S%U?ZU=z)N@mCnrB?t1GSt_f2uFbUeJbe9-oUn8*Eu!xhwfSpO<&*Ve$ zdT;gc6sDM|6u5DGw+f8imsVI~h>KtlvUK?#r-1l$|IT3>ri`f(n5^~UFXFyzR_lmC z^IHJSV+^+TZvXfcri7^wxN&@M3pqSAZLR5<9-&JuaM%>{g9-Xp4;h|uWS-#YapdQW z!@0ElVDKdS>_rr?h#*{s@@K#$*%U7^gfSnW@(W!`frIAwhJPTx@LHPdkpYc}TT;2R z`H#Q6-d#VPXcXKyUUB)%+?T>fdfzGpqwrL;0G;jqJ1q}NM(G45t3}RVB{j#NMCEY0 z_sz4nV1SL6YhOuAugf3n$yb-tnoA{cw^wSvI`fuaa?zS zi8l!YsaECU*GEMOJ4_%no85%irkim&mzJ2YJc!x$I1alBTKm=d+h>Y>uf-pX?sK!Nt?8FV{0x(~rH<}H}9O~p~!G+$o3 zem4?CwG|82G;PI31&*>_IqBcJ&Q0?$y=1-C@NpV&nYLoH793%{d$*rYP12e+qFOBE zbufrAfrEUi2HF^f!@VhdDISW=h-v6A|+Xqp7?~y@@>=^T8HBRpRS7E`e z{gr2#=Djp1`7rmJ>u|o9N14fk=c`NfUcM0LKYV+11{rCbtWjvOI(Uq{TMHfM3lsM; z0|tm{p0kdezdKoLUNEugpc9NdI}1L2VXexA^GNrX^WbHD$q_!y->dYy<2dxtW)Axy z$5SR)b?{g)*s63XnZ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*|xT>5Vu4arQMB#HheQj&Xz)rU^uHI4)HNDia#I%Dy!q97Cwr2+Ly(VO(IcV%1tvX{z*8$>F9P z0%-{DMO7IneB~f1Y?{^GQC>?~!BGOBiS2vTJz{JMMw@rl6Weq9WObCBD$8;H^1g%m;D3dJy$;x4- zpvySqDlieZ%f+7^gg)ZD!=fr%uM z%d|zDiWJ-57Ah`LsK5k?>i^XEGSS%Kc#bU8oEEbE!VzF2(7K_DVu~;mY3Hcq_s<6s+ { TextEditingController heightController = TextEditingController(); + TextEditingController inchesController = TextEditingController(); + TextEditingController cmsController = TextEditingController(); TextEditingController weightController = TextEditingController(); TextEditingController ageController = TextEditingController(); + TextEditingController dateInput = TextEditingController(); + String bmiValue = ''; String bmiText = ''; var heightUnitItems = [ 'feet', 'cm', - 'inches', ]; var heightUnits = 'feet'; var weightUnitItems = [ 'kg', - 'gr', ]; var weightUnits = 'kg'; + + + @override + void initState() { + ageController.text=AppSettings.age; + super.initState(); + } @override Widget build(BuildContext context) { return Scaffold( @@ -45,11 +54,13 @@ class _BMICalculatorState extends State { cursorColor: greyColor, controller: ageController, textCapitalization: TextCapitalization.characters, + keyboardType: TextInputType.number, decoration: const InputDecoration( prefixIcon: Icon( Icons.person, color: primaryColor, ), + suffixText: "Yrs", border: OutlineInputBorder( borderSide: BorderSide(color: primaryColor)), focusedBorder: OutlineInputBorder( @@ -65,7 +76,57 @@ class _BMICalculatorState extends State { ), ), SizedBox(height: 10), - Container( + DropdownButtonFormField( + // Initial Value + value: heightUnits, + isExpanded: true, + decoration: const InputDecoration( + prefixIcon: Icon( + Icons.ac_unit_outlined, + color: primaryColor, + ), + border: OutlineInputBorder( + borderSide: BorderSide(color: primaryColor)), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide(color: primaryColor), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide(color: primaryColor), + ), + labelText: 'Select Height units', + labelStyle: TextStyle( + color: greyColor, //<-- SEE HERE + ), + ), + + hint: Text('Units'), + // Down Arrow Icon + //icon: const Icon(Icons.keyboard_arrow_down), + + // Array list of items + items: heightUnitItems.map((String items) { + return DropdownMenuItem( + value: items, + child: Text( + items, + style: TextStyle( + fontSize: 16, + ), + textAlign: TextAlign.center, + )); + }).toList(), + // After selecting the desired option,it will + // change button value to selected value + onChanged: (String? newValue) { + setState(() { + heightUnits = newValue!; + }); + }, + ), + SizedBox(height: 10), + Visibility( + visible:heightUnits=='feet', + child: Container( //height: 60, child: Row( children: [ @@ -74,6 +135,7 @@ class _BMICalculatorState extends State { cursorColor: greyColor, controller: heightController, textCapitalization: TextCapitalization.characters, + keyboardType: TextInputType.number, decoration: const InputDecoration( prefixIcon: Icon( Icons.height, @@ -87,7 +149,7 @@ class _BMICalculatorState extends State { enabledBorder: OutlineInputBorder( borderSide: BorderSide(color: primaryColor), ), - labelText: 'Height', + labelText: 'Feets', labelStyle: TextStyle( color: greyColor, //<-- SEE HERE ), @@ -96,13 +158,14 @@ class _BMICalculatorState extends State { ), SizedBox(width: 5), Expanded( - child: DropdownButtonFormField( - // Initial Value - value: heightUnits, - isExpanded: true, + child: TextFormField( + cursorColor: greyColor, + controller: inchesController, + textCapitalization: TextCapitalization.characters, + keyboardType: TextInputType.number, decoration: const InputDecoration( prefixIcon: Icon( - Icons.ac_unit_outlined, + Icons.height, color: primaryColor, ), border: OutlineInputBorder( @@ -113,40 +176,54 @@ class _BMICalculatorState extends State { enabledBorder: OutlineInputBorder( borderSide: BorderSide(color: primaryColor), ), - labelText: 'Units', + labelText: 'Inches', labelStyle: TextStyle( color: greyColor, //<-- SEE HERE ), ), - - hint: Text('Units'), - // Down Arrow Icon - //icon: const Icon(Icons.keyboard_arrow_down), - - // Array list of items - items: heightUnitItems.map((String items) { - return DropdownMenuItem( - value: items, - child: Text( - items, - style: TextStyle( - fontSize: 16, - ), - textAlign: TextAlign.center, - )); - }).toList(), - // After selecting the desired option,it will - // change button value to selected value - onChanged: (String? newValue) { - setState(() { - heightUnits = newValue!; - }); - }, ), - ) + ), + SizedBox(width: 5), + ], ), - ), + ),), + Visibility( + visible:heightUnits=='cm', + child: Container( + //height: 60, + child: Row( + children: [ + Expanded( + child: TextFormField( + cursorColor: greyColor, + controller: cmsController, + textCapitalization: TextCapitalization.characters, + keyboardType: TextInputType.number, + decoration: const InputDecoration( + prefixIcon: Icon( + Icons.height, + color: primaryColor, + ), + border: OutlineInputBorder( + borderSide: BorderSide(color: primaryColor)), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide(color: primaryColor), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide(color: primaryColor), + ), + labelText: 'Enter height in cms', + labelStyle: TextStyle( + color: greyColor, //<-- SEE HERE + ), + ), + ), + ), + + ], + ), + ),), SizedBox(height: 10), Container( //height: 40, @@ -158,6 +235,7 @@ class _BMICalculatorState extends State { cursorColor: greyColor, controller: weightController, textCapitalization: TextCapitalization.characters, + keyboardType: TextInputType.number, decoration: const InputDecoration( prefixIcon: Icon( Icons.line_weight_outlined, @@ -232,48 +310,136 @@ class _BMICalculatorState extends State { ), ), SizedBox(height: 10), - TextButton( - child: Text('Calculate BMI', style: textButtonStyle()), - onPressed: () async { - if (ageController.text != '' && - heightController.text != '' && - weightController.text != '') { - var payload = new Map(); + Container( + child: TextFormField( + cursorColor: greyColor, + controller: dateInput, + decoration: textFormFieldDecorationBMI( + Icons.calendar_today, 'Enter Date'), + readOnly: true, + onTap: () async { + DateTime? pickedDate = await showDatePicker( + context: context, + initialDate: DateTime.now(), + firstDate: DateTime(1950), + lastDate: DateTime.now(), + builder: (BuildContext context, Widget? child) { + return Theme( + data: ThemeData.dark().copyWith( + colorScheme: ColorScheme.dark( + primary: buttonColors, + onPrimary: Colors.white, + surface: buttonColors, + onSurface: Colors.white, + ), + dialogBackgroundColor: primaryColor, + ), + child: child!, + ); + }, + ); + + if (pickedDate != null) { + print( + pickedDate); //pickedDate output format => 2021-03-10 00:00:00.000 + String formattedDate = + DateFormat('dd-MM-yyyy').format(pickedDate); + print( + formattedDate); //formatted date output using intl package => 2021-03-16 + setState(() { + dateInput.text = + formattedDate; //set output date to TextField value. + }); + } else {} + }, + ), + ), + SizedBox(height: 10), + Container( + width: double.infinity, + height: + MediaQuery.of(context).size.height * .05, + child: ElevatedButton( + style: ElevatedButton.styleFrom( + primary: buttonColors, // background + onPrimary: Colors.black, // foreground + ), + onPressed: () async { + if (ageController.text != '' && + heightController.text != '' ||cmsController.text!=''&& + weightController.text != ''&&dateInput.text!='') { + + AppSettings.preLoaderDialog(context); + var payload = new Map(); + + if(heightUnits.toString().toLowerCase()=='feet'){ + cmsController.text=''; + } + else{ + heightController.text=''; + inchesController.text=''; + } + + payload["age"] = int.parse(ageController.text.toString()); + payload["feet"] = heightController.text.toString(); + payload["inches"] = inchesController.text.toString(); + payload["height"] = cmsController.text.toString(); + payload["weight"] = weightController.text.toString(); + payload["heightUnit"] = heightUnits.toString(); + payload["weightUnit"] = weightUnits.toString(); + payload["date"] = dateInput.text.toString(); + + try{ + var value = await AppSettings.calculateBmi(payload); + var valueResponse = jsonDecode(value); + Navigator.of(context, rootNavigator: true).pop(); + heightController.clear(); + cmsController.clear(); + inchesController.clear(); + weightController.clear(); + dateInput.clear(); + setState(() { + bmiValue = valueResponse['userDetails']['bmivalue'].toString(); + if(double.parse(bmiValue)<18.5){ + bmiText='Underweight'; + } + else if(double.parse(bmiValue)>=18.5&&double.parse(bmiValue)<=24.9){ + bmiText='Normal weight'; + } + else if(double.parse(bmiValue)>=25&&double.parse(bmiValue)<=29.9){ + bmiText='Overweight'; + } + else if(double.parse(bmiValue)>=30){ + bmiText='Obesity'; + } + + + }); + + + + } + catch(e){ + Navigator.of(context, rootNavigator: true).pop(); + AppSettings.longFailedToast('Calculating BMI failed'); + } + + - payload["age"] = - int.parse(ageController.text.toString()); - payload["height"] = heightController.text.toString(); - payload["weight"] = weightController.text.toString(); - payload["heightUnit"] = heightUnits.toString(); - payload["weightUnit"] = weightUnits.toString(); - var value = await AppSettings.calculateBmi(payload); - var valueResponse = jsonDecode(value); - print(valueResponse); - setState(() { - bmiValue = valueResponse['userDetails']['bmivalue'].toString(); - if(double.parse(bmiValue)<18.5){ - bmiText='Underweight'; - } - else if(double.parse(bmiValue)>=18.5&&double.parse(bmiValue)<=24.9){ - bmiText='Normal weight'; - } - else if(double.parse(bmiValue)>=25&&double.parse(bmiValue)<=29.9){ - bmiText='Overweight'; } - else if(double.parse(bmiValue)>=30){ - bmiText='Obesity'; + else{ + AppSettings.longFailedToast('Please enter valid details'); } - }); - } - }, - ), - SizedBox(height: 10), + }, + child: const Text('Calculate BMI'), + )), + SizedBox(height: 20), Container( child: Row( children: [ - Text('Your Bmi value: $bmiValue'), + Text('Your BMI value: $bmiValue',style: TextStyle(fontSize:15,fontWeight: FontWeight.bold),), SizedBox(width: 10,), - Text(bmiText,style: TextStyle(color: Colors.red)), + Text(bmiText,style: TextStyle(color: Colors.red,fontWeight: FontWeight.bold)), ], ) ), diff --git a/lib/BMI/bmi_history.dart b/lib/BMI/bmi_history.dart index a07f870..52a99b6 100644 --- a/lib/BMI/bmi_history.dart +++ b/lib/BMI/bmi_history.dart @@ -1,11 +1,9 @@ import 'dart:convert'; import 'package:healthcare_user/chart/bmi_chart.dart'; -import 'package:intl/intl.dart'; import 'package:flutter/material.dart'; import 'package:healthcare_user/models/bmi_history_model.dart'; import 'package:healthcare_user/common/settings.dart'; - -import '../chart/bpchart.dart'; +import 'package:flutter_slidable/flutter_slidable.dart'; class BMIHistory extends StatefulWidget { const BMIHistory({Key? key}) : super(key: key); @@ -19,11 +17,12 @@ class _BMIHistoryState extends State { List bmiHistoryList = []; List FilteredList = []; var dateItems = [ + 'All', 'last 7 days', 'last one month', 'last one year', ]; - var dateItemsVariable = 'last 7 days'; + var dateItemsVariable = 'All'; Future getBmiHistoryDetails(var selectedRange) async { isLoading = true; @@ -43,6 +42,7 @@ class _BMIHistoryState extends State { FilteredList = bmiHistoryList.where((product) { final date = product.dateForFilter; return now_1w.isBefore(date); + //reportsList=reportsListOriginal.reversed.toList(); }).toList(); } else if (selectedRange.toString().toUpperCase() == 'LAST ONE MONTH') { FilteredList = bmiHistoryList.where((product) { @@ -68,6 +68,27 @@ class _BMIHistoryState extends State { super.initState(); } + deleteBmiHistory(bmiId) async{ + + AppSettings.preLoaderDialog(context); + bool status = await AppSettings.deleteBMIDetails(bmiId); + + if(status){ + Navigator.of(context, rootNavigator: true).pop(); + + AppSettings.longSuccessToast("BMI record deleted successfully"); + await getBmiHistoryDetails(dateItemsVariable); + } + else{ + Navigator.of(context, rootNavigator: true).pop(); + + AppSettings.longFailedToast("BMI record deletion failed"); + } + + + + } + Widget renderzUi() { if (bmiHistoryList.length != 0) { return Column(crossAxisAlignment: CrossAxisAlignment.end, children: [ @@ -90,7 +111,7 @@ class _BMIHistoryState extends State { enabledBorder: OutlineInputBorder( borderSide: BorderSide(color: primaryColor), ), - labelText: 'Units', + labelText: 'Select Date Range', labelStyle: TextStyle( color: greyColor, //<-- SEE HERE ), @@ -145,113 +166,168 @@ class _BMIHistoryState extends State { padding: EdgeInsets.all(0), itemCount: FilteredList.length, itemBuilder: (BuildContext context, int index) { - return Card( - color: Colors.white, - child: Padding( - padding: EdgeInsets.all(8), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Container( - width: MediaQuery.of(context).size.width * .55, - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Image( - image: const AssetImage( - 'images/height.png'), - height: 25, - width: 25, - fit: BoxFit.fill), - Padding( - padding: EdgeInsets.all(5), - child: Text( - FilteredList[index] - .height - .toString() - .toUpperCase() + - ' ft', - style: valuesTextStyle()), - ) - ], - ), - Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Image( - image: const AssetImage( - 'images/weight.png'), - height: 25, - width: 25, - fit: BoxFit.fill), - Padding( - padding: EdgeInsets.all(5), - child: Text( - FilteredList[index] - .weight - .toString() - .toUpperCase() + - ' Kgs', - style: valuesTextStyle()), - ) - ], - ), - Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Image( - image: - const AssetImage('images/date.png'), - height: 25, - width: 25, - fit: BoxFit.fill), - Padding( - padding: EdgeInsets.all(5), - child: Text( - FilteredList[index] - .displayDate - .toString() - .toUpperCase(), - style: valuesTextStyle()), - ) - ], - ), - Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Image( - image: const AssetImage( - 'images/weight.png'), - height: 25, - width: 25, - fit: BoxFit.fill), - Padding( - padding: EdgeInsets.all(5), - child: Text( - FilteredList[index] - .bmiValue - .toString() - .toUpperCase(), - style: valuesTextStyle()), - ) - ], - ), - ], + return Slidable( + key: const ValueKey(0), + endActionPane: ActionPane( + // A motion is a widget used to control how the pane animates. + motion: ScrollMotion(), + + dragDismissible: false, + // A pane can dismiss the Slidable. + dismissible: DismissiblePane(onDismissed: () { + deleteBmiHistory(FilteredList[index].bmiInfoId); + }), + + // All actions are defined in the children parameter. + children: [ + // A SlidableAction can have an icon and/or a label. + SlidableAction( + backgroundColor: Color(0xFFFE4A49), + foregroundColor: Colors.white, + icon: Icons.delete, + label: 'Delete', + onPressed: (BuildContext context) { + deleteBmiHistory(FilteredList[index].bmiInfoId); + }, + ), + /*SlidableAction( + onPressed: doNothing, + backgroundColor: Color(0xFF21B7CA), + foregroundColor: Colors.white, + icon: Icons.share, + label: 'Share', + ),*/ + ], + ), + child: Card( + color: Colors.white, + child: Padding( + padding: EdgeInsets.all(8), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Container( + width: MediaQuery.of(context).size.width * .55, + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Image( + image: const AssetImage( + 'images/height.png'), + height: 25, + width: 25, + fit: BoxFit.fill), + Padding( + padding: EdgeInsets.all(5), + child: Text( + FilteredList[index] + .height + .toString() + .toUpperCase() + + ' cms', + style: valuesTextStyle()), + ) + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Image( + image: const AssetImage( + 'images/weight.png'), + height: 25, + width: 25, + fit: BoxFit.fill), + Padding( + padding: EdgeInsets.all(5), + child: Text( + FilteredList[index] + .weight + .toString() + .toUpperCase() + + ' Kgs', + style: valuesTextStyle()), + ) + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Image( + image: + const AssetImage('images/date.png'), + height: 25, + width: 25, + fit: BoxFit.fill), + Padding( + padding: EdgeInsets.all(5), + child: Text( + FilteredList[index] + .actualDate + .toString() + .toUpperCase(), + style: valuesTextStyle()), + ) + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Image( + image: const AssetImage( + 'images/bmi.png'), + height: 25, + width: 25, + fit: BoxFit.fill), + Padding( + padding: EdgeInsets.all(5), + child: Text( + FilteredList[index] + .bmiValue + .toString() + .toUpperCase(), + style: valuesTextStyle()), + ) + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Image( + image: const AssetImage( + 'images/bmi.png'), + height: 25, + width: 25, + fit: BoxFit.fill), + Padding( + padding: EdgeInsets.all(5), + child: Text( + FilteredList[index].bmiText + .toString() + .toUpperCase(), + style: valuesTextStyle()), + ) + ], + ), + ], + ), ), - ), - ], + ], + ), ), ), - ); + ); + })), ]); } else { diff --git a/lib/BP/bp_calculator.dart b/lib/BP/bp_calculator.dart index aa0e86e..4a2a512 100644 --- a/lib/BP/bp_calculator.dart +++ b/lib/BP/bp_calculator.dart @@ -1,9 +1,8 @@ import 'dart:convert'; - import 'package:flutter/material.dart'; -import 'package:healthcare_user/BMI/bmi_history.dart'; import 'package:healthcare_user/BP/bp_history.dart'; import 'package:healthcare_user/common/settings.dart'; +import 'package:intl/intl.dart'; class BPCalculator extends StatefulWidget { const BPCalculator({Key? key}) : super(key: key); @@ -16,19 +15,10 @@ class _BPCalculatorState extends State { TextEditingController systoloicController = TextEditingController(); TextEditingController diastolicController = TextEditingController(); + TextEditingController dateInput = TextEditingController(); String bpValue = ''; String bpText = ''; - var heightUnitItems = [ - 'feet', - 'cm', - 'inches', - ]; - var heightUnits = 'feet'; - var weightUnitItems = [ - 'kg', - 'gr', - ]; - var weightUnits = 'kg'; + @override Widget build(BuildContext context) { return Scaffold( @@ -45,9 +35,10 @@ class _BPCalculatorState extends State { cursorColor: greyColor, controller: systoloicController, textCapitalization: TextCapitalization.characters, + keyboardType: TextInputType.number, decoration: const InputDecoration( prefixIcon: Icon( - Icons.person, + Icons.upload, color: primaryColor, ), border: OutlineInputBorder( @@ -69,9 +60,10 @@ class _BPCalculatorState extends State { cursorColor: greyColor, controller: diastolicController, textCapitalization: TextCapitalization.characters, + keyboardType: TextInputType.number, decoration: const InputDecoration( prefixIcon: Icon( - Icons.person, + Icons.download, color: primaryColor, ), border: OutlineInputBorder( @@ -89,47 +81,92 @@ class _BPCalculatorState extends State { ), ), SizedBox(height: 10), - TextButton( - child: Text('Check BP', style: textButtonStyle()), - onPressed: () async { - if (systoloicController.text != '' && - diastolicController.text != '') { - AppSettings.preLoaderDialog(context); - var payload = new Map(); + Container( + child: TextFormField( + cursorColor: greyColor, + controller: dateInput, + decoration: textFormFieldDecorationBMI( + Icons.calendar_today, 'Enter Date'), + readOnly: true, + onTap: () async { + DateTime? pickedDate = await showDatePicker( + context: context, + initialDate: DateTime.now(), + firstDate: DateTime(1950), + lastDate: DateTime.now(), + builder: (BuildContext context, Widget? child) { + return Theme( + data: ThemeData.dark().copyWith( + colorScheme: ColorScheme.dark( + primary: buttonColors, + onPrimary: Colors.white, + surface: buttonColors, + onSurface: Colors.white, + ), + dialogBackgroundColor: primaryColor, + ), + child: child!, + ); + }, + ); - payload["Systolic"] = double.parse(systoloicController.text.toString()); - payload["Diastolic"] = double.parse(diastolicController.text.toString()); + if (pickedDate != null) { + print( + pickedDate); //pickedDate output format => 2021-03-10 00:00:00.000 + String formattedDate = + DateFormat('dd-MM-yyyy').format(pickedDate); + print( + formattedDate); //formatted date output using intl package => 2021-03-16 + setState(() { + dateInput.text = + formattedDate; //set output date to TextField value. + }); + } else {} + }, + ), + ), + SizedBox(height: 10), + Container( + width: double.infinity, + height: + MediaQuery.of(context).size.height * .05, + child: ElevatedButton( + style: ElevatedButton.styleFrom( + primary: buttonColors, // background + onPrimary: Colors.black, // foreground + ), + onPressed: () async { + if (systoloicController.text != '' && + diastolicController.text != ''&&dateInput.text!='') { + AppSettings.preLoaderDialog(context); + var payload = new Map(); - var value = await AppSettings.calculateBP(payload); - var valueResponse = jsonDecode(value); - print(valueResponse); - setState(() { - bpValue = valueResponse['userDetails']['bpCategory'].toString(); - /*bpValue = valueResponse['userDetails']['bmivalue'].toString(); - if(double.parse(bpValue)<18.5){ - bpText='Underweight'; - } - else if(double.parse(bpValue)>=18.5&&double.parse(bpValue)<=24.9){ - bpText='Normal weight'; + payload["Systolic"] = double.parse(systoloicController.text.toString()); + payload["Diastolic"] = double.parse(diastolicController.text.toString()); + payload["date"] =dateInput.text.toString(); + + var value = await AppSettings.calculateBP(payload); + var valueResponse = jsonDecode(value); + print(valueResponse); + setState(() { + bpValue = valueResponse['userDetails']['bpCategory'].toString(); + }); + systoloicController.clear(); + diastolicController.clear(); + dateInput.clear(); + Navigator.of(context,rootNavigator: true).pop(); } - else if(double.parse(bpValue)>=25&&double.parse(bpValue)<=29.9){ - bpText='Overweight'; + else{ + AppSettings.longFailedToast('Please enter valid details'); } - else if(double.parse(bpValue)>=30){ - bpText='Obesity'; - }*/ - }); - systoloicController.clear(); - diastolicController.clear(); - Navigator.of(context,rootNavigator: true).pop(); - } - }, - ), - SizedBox(height: 10), + }, + child: const Text('Check BP'), + )), + SizedBox(height: 20), Container( child: Row( children: [ - Text(bpValue,style: TextStyle(color: Colors.red),), + Text(bpValue,style: TextStyle(color: Colors.red,fontWeight: FontWeight.bold,fontSize: 15),), ], ) ), diff --git a/lib/BP/bp_history.dart b/lib/BP/bp_history.dart index ece8c03..9bc2293 100644 --- a/lib/BP/bp_history.dart +++ b/lib/BP/bp_history.dart @@ -1,9 +1,9 @@ import 'dart:convert'; import 'package:flutter/material.dart'; import 'package:healthcare_user/chart/bpchart.dart'; -import 'package:healthcare_user/models/bmi_history_model.dart'; import 'package:healthcare_user/common/settings.dart'; import 'package:healthcare_user/models/bp_history_model.dart'; +import 'package:flutter_slidable/flutter_slidable.dart'; class BPHistory extends StatefulWidget { const BPHistory({Key? key}) : super(key: key); @@ -13,247 +13,308 @@ class BPHistory extends StatefulWidget { } class _BPHistoryState extends State { - - bool isLoading=false; + bool isLoading = false; List BpHistoryList = []; List FilteredList = []; var dateItems = [ + 'All', 'last 7 days', 'last one month', 'last one year', ]; - var dateItemsVariable = 'last 7 days'; + var dateItemsVariable = 'All'; - Future getBmiHistoryDetails(var selectedRange) async { - isLoading=true; - var response1= await AppSettings.getBPHistory(); + Future getBPHistoryDetails(var selectedRange) async { + isLoading = true; + var response1 = await AppSettings.getBPHistory(); print(response1); setState(() { - BpHistoryList = - ((jsonDecode(response1)) as List).map((dynamic model) { - return BPHistoryModel.fromJson(model); - }).toList(); + BpHistoryList = ((jsonDecode(response1)) as List).map((dynamic model) { + return BPHistoryModel.fromJson(model); + }).toList(); var now = new DateTime.now(); var now_1w = now.subtract(Duration(days: 7)); - var now_1m = new DateTime(now.year, now.month-1, now.day); - var now_1y = new DateTime(now.year-1, now.month, now.day); + var now_1m = new DateTime(now.year, now.month - 1, now.day); + var now_1y = new DateTime(now.year - 1, now.month, now.day); - if(selectedRange.toString().toUpperCase()=='LAST 7 DAYS'){ - FilteredList=BpHistoryList.where((product) { + if (selectedRange.toString().toUpperCase() == 'LAST 7 DAYS') { + FilteredList = BpHistoryList.where((product) { final date = product.dateForFilter; return now_1w.isBefore(date); }).toList(); - } - else if(selectedRange.toString().toUpperCase()=='LAST ONE MONTH'){ - FilteredList=BpHistoryList.where((product) { + } else if (selectedRange.toString().toUpperCase() == 'LAST ONE MONTH') { + FilteredList = BpHistoryList.where((product) { final date = product.dateForFilter; return now_1m.isBefore(date); }).toList(); - } - else if(selectedRange.toString().toUpperCase()=='LAST ONE YEAR'){ - FilteredList=BpHistoryList.where((product) { + } else if (selectedRange.toString().toUpperCase() == 'LAST ONE YEAR') { + FilteredList = BpHistoryList.where((product) { final date = product.dateForFilter; return now_1y.isBefore(date); }).toList(); - } - else{ - FilteredList=BpHistoryList; + } else { + FilteredList = BpHistoryList; } - - isLoading=false; + isLoading = false; }); } @override void initState() { - getBmiHistoryDetails(dateItemsVariable); + getBPHistoryDetails(dateItemsVariable); super.initState(); } - Widget renderzUi(){ - if(BpHistoryList.length!=0){ + deleteBpRecord(bpId) async { + AppSettings.preLoaderDialog(context); + bool status = await AppSettings.deleteBPDetails(bpId); - return Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Padding(padding: EdgeInsets.fromLTRB(10, 10, 10, 10), - child: DropdownButtonFormField( - // Initial Value - value: dateItemsVariable, - isExpanded: true, - decoration: const InputDecoration( - prefixIcon: Icon( - Icons.calendar_month, - color: primaryColor, - ), - border: OutlineInputBorder( - borderSide: BorderSide(color: primaryColor)), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide(color: primaryColor), - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide(color: primaryColor), - ), - labelText: 'Units', - labelStyle: TextStyle( - color: greyColor, //<-- SEE HERE - ), - ), + if (status) { + Navigator.of(context, rootNavigator: true).pop(); - hint: Text('Units'), - // Down Arrow Icon - //icon: const Icon(Icons.keyboard_arrow_down), + AppSettings.longSuccessToast("BP record deleted successfully"); + await getBPHistoryDetails(dateItemsVariable); + } else { + Navigator.of(context, rootNavigator: true).pop(); - // Array list of items - items: dateItems.map((String items) { - return DropdownMenuItem( - value: items, - child: Text( - items, - style: TextStyle( - fontSize: 16, - ), - textAlign: TextAlign.center, - )); - }).toList(), - // After selecting the desired option,it will - // change button value to selected value - onChanged: (String? newValue) { - setState(() { - dateItemsVariable = newValue!; - }); - getBmiHistoryDetails(dateItemsVariable); - }, - ),), + AppSettings.longFailedToast("BP record deletion failed"); + } + } - IconButton( - onPressed: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => Bpchart()), - ); - // showBMIAdddialog(); - }, - icon: Icon( - Icons.auto_graph, + Widget renderzUi() { + if (BpHistoryList.length != 0) { + return Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + Padding( + padding: EdgeInsets.fromLTRB(10, 10, 10, 10), + child: DropdownButtonFormField( + // Initial Value + value: dateItemsVariable, + isExpanded: true, + decoration: const InputDecoration( + prefixIcon: Icon( + Icons.calendar_month, color: primaryColor, ), + border: OutlineInputBorder( + borderSide: BorderSide(color: primaryColor)), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide(color: primaryColor), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide(color: primaryColor), + ), + labelText: 'Select Date Range', + labelStyle: TextStyle( + color: greyColor, //<-- SEE HERE + ), ), - Expanded(child:ListView.builder( - padding: EdgeInsets.all(0), + hint: Text('Units'), + // Down Arrow Icon + //icon: const Icon(Icons.keyboard_arrow_down), + + // Array list of items + items: dateItems.map((String items) { + return DropdownMenuItem( + value: items, + child: Text( + items, + style: TextStyle( + fontSize: 16, + ), + textAlign: TextAlign.center, + )); + }).toList(), + // After selecting the desired option,it will + // change button value to selected value + onChanged: (String? newValue) { + setState(() { + dateItemsVariable = newValue!; + }); + getBPHistoryDetails(dateItemsVariable); + }, + ), + ), + IconButton( + onPressed: () { + Navigator.push( + context, + MaterialPageRoute(builder: (context) => Bpchart()), + ); + // showBMIAdddialog(); + }, + icon: Icon( + Icons.auto_graph, + color: primaryColor, + ), + ), + Expanded( + child: ListView.builder( + padding: EdgeInsets.all(0), itemCount: FilteredList.length, itemBuilder: (BuildContext context, int index) { - return Card( + return Slidable( + key: const ValueKey(0), + endActionPane: ActionPane( + // A motion is a widget used to control how the pane animates. + motion: ScrollMotion(), - color: Colors.white, - child: Padding( - padding:EdgeInsets.all(8) , - child: Container( - width: MediaQuery.of(context).size.width * .55, - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( + dragDismissible: false, + // A pane can dismiss the Slidable. + dismissible: DismissiblePane(onDismissed: () { + deleteBpRecord(FilteredList[index].bpId); + }), + + // All actions are defined in the children parameter. + children: [ + // A SlidableAction can have an icon and/or a label. + SlidableAction( + backgroundColor: Color(0xFFFE4A49), + foregroundColor: Colors.white, + icon: Icons.delete, + label: 'Delete', + onPressed: (BuildContext context) { + deleteBpRecord(FilteredList[index].bpId); + }, + ), + ], + ), + child: Card( + color: Colors.white, + child: Padding( + padding: EdgeInsets.all(8), + child: Container( + //width: MediaQuery.of(context).size.width * .55, + child: Column( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ - /* Image( + Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + /* Image( image: const AssetImage('images/height.png'), height: 25, width: 25, fit: BoxFit.fill),*/ - Text('Systolic',style: TextStyle(color: primaryColor),), - SizedBox(width: 5,), - Padding(padding: EdgeInsets.all(1), - child: Text(FilteredList[index].systolic.toString().toUpperCase(),style: valuesTextStyle()),) - - ], - ), - Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text('Diastolic',style: TextStyle(color: primaryColor),), - Padding(padding: EdgeInsets.all(1), - child: Text(FilteredList[index].diastolic.toString().toUpperCase(),style: valuesTextStyle()),) - - ], - ), - Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Image( - image: const AssetImage('images/height.png'), - height: 25, - width: 25, - fit: BoxFit.fill), - Padding(padding: EdgeInsets.all(5), - child: Text(FilteredList[index].bpText.toString().toUpperCase(),style: valuesTextStyle()),) - - ], - ), - Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Image( - image: const AssetImage('images/date.png'), - height: 25, - width: 25, - fit: BoxFit.fill), - Padding(padding: EdgeInsets.all(5), - child: Text(FilteredList[index].displayDate.toString().toUpperCase(),style: valuesTextStyle()),) - + Text( + 'Systolic', + style: TextStyle(color: primaryColor), + ), + SizedBox( + width: 5, + ), + Padding( + padding: EdgeInsets.all(1), + child: Text( + FilteredList[index] + .systolic + .toString() + .toUpperCase(), + style: valuesTextStyle()), + ) + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + 'Diastolic', + style: TextStyle(color: primaryColor), + ), + Padding( + padding: EdgeInsets.all(1), + child: Text( + FilteredList[index] + .diastolic + .toString() + .toUpperCase(), + style: valuesTextStyle()), + ) + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Image( + image: const AssetImage( + 'images/height.png'), + height: 25, + width: 25, + fit: BoxFit.fill), + Padding( + padding: EdgeInsets.all(5), + child: Text( + FilteredList[index] + .bpText + .toString() + .toUpperCase(), + style: valuesTextStyle()), + ) + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Image( + image: + const AssetImage('images/date.png'), + height: 25, + width: 25, + fit: BoxFit.fill), + Padding( + padding: EdgeInsets.all(5), + child: Text( + FilteredList[index] + .actualDate + .toString() + .toUpperCase(), + style: valuesTextStyle()), + ) + ], + ), ], ), - - - ], + ), ), - - - ), - ), - ); - }) ), - ]); - } - else{ - return Center( + )); + })), + ]); + } else { + return Center( child: Padding( - padding: EdgeInsets.fromLTRB(0, 40, 0, 0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - SizedBox(height: MediaQuery.of(context).size.height * .25,), - Text('No data'), - SizedBox( - height: 20, - ), - CircleAvatar( - backgroundColor: primaryColor, - radius: 40, - child: IconButton( - iconSize: 40, - icon: const Icon( - Icons.info, - color: Colors.white, - ), - onPressed: () async { - - }, - ), - ) - ], + padding: EdgeInsets.fromLTRB(0, 40, 0, 0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + SizedBox( + height: MediaQuery.of(context).size.height * .25, ), - ) - ); + Text('No data'), + SizedBox( + height: 20, + ), + CircleAvatar( + backgroundColor: primaryColor, + radius: 40, + child: IconButton( + iconSize: 40, + icon: const Icon( + Icons.info, + color: Colors.white, + ), + onPressed: () async {}, + ), + ) + ], + ), + )); } } @@ -261,12 +322,14 @@ class _BPHistoryState extends State { Widget build(BuildContext context) { return Scaffold( appBar: AppSettings.appBar('Blood Pressure'), - body: isLoading?Center( - child: CircularProgressIndicator( - color: primaryColor, - strokeWidth: 5.0, - ), - ):renderzUi(), + body: isLoading + ? Center( + child: CircularProgressIndicator( + color: primaryColor, + strokeWidth: 5.0, + ), + ) + : renderzUi(), ); } } diff --git a/lib/Reports/add_reports.dart b/lib/Reports/add_reports.dart index 0d94aaf..29c585e 100644 --- a/lib/Reports/add_reports.dart +++ b/lib/Reports/add_reports.dart @@ -1158,8 +1158,7 @@ class _AddReportsState extends State { payload["reports"] = uiReportsImages; payload["prescription"] = uiPrescriptionImages; - bool uploadStatus = - await AppSettings.addRecords(payload); + bool uploadStatus = await AppSettings.addRecords(payload); try { if (uploadStatus) { diff --git a/lib/Reports/all_records_tab.dart b/lib/Reports/all_records_tab.dart index 1bcbfa7..be36764 100644 --- a/lib/Reports/all_records_tab.dart +++ b/lib/Reports/all_records_tab.dart @@ -1000,6 +1000,7 @@ class _AllReportsTabState extends State title: Text('Reports'), backgroundColor: primaryColor, bottom: TabBar( + isScrollable: true, controller: _controller, tabs: topTabs, indicatorColor: buttonColors, diff --git a/lib/Sugar/sugar_calculator.dart b/lib/Sugar/sugar_calculator.dart index d81da1a..a031be0 100644 --- a/lib/Sugar/sugar_calculator.dart +++ b/lib/Sugar/sugar_calculator.dart @@ -1,10 +1,9 @@ import 'dart:convert'; - import 'package:flutter/material.dart'; -import 'package:healthcare_user/BMI/bmi_history.dart'; -import 'package:healthcare_user/BP/bp_history.dart'; import 'package:healthcare_user/Sugar/sugar_history.dart'; import 'package:healthcare_user/common/settings.dart'; +import 'package:intl/intl.dart'; + class SugarCalculator extends StatefulWidget { const SugarCalculator({Key? key}) : super(key: key); @@ -17,6 +16,7 @@ class _SugarCalculatorState extends State { TextEditingController fastingValueController = TextEditingController(); TextEditingController postParandialValueController = TextEditingController(); + TextEditingController dateInput = TextEditingController(); String sugarValue = ''; @override Widget build(BuildContext context) { @@ -80,35 +80,94 @@ class _SugarCalculatorState extends State { ), ), SizedBox(height: 10), - TextButton( - child: Text('Check Sugar', style: textButtonStyle()), - onPressed: () async { - if (fastingValueController.text != '' && - postParandialValueController.text != '') { - AppSettings.preLoaderDialog(context); - var payload = new Map(); + SizedBox(height: 10), + Container( + child: TextFormField( + cursorColor: greyColor, + controller: dateInput, + decoration: textFormFieldDecorationBMI( + Icons.calendar_today, 'Enter Date'), + readOnly: true, + onTap: () async { + DateTime? pickedDate = await showDatePicker( + context: context, + initialDate: DateTime.now(), + firstDate: DateTime(1950), + lastDate: DateTime.now(), + builder: (BuildContext context, Widget? child) { + return Theme( + data: ThemeData.dark().copyWith( + colorScheme: ColorScheme.dark( + primary: buttonColors, + onPrimary: Colors.white, + surface: buttonColors, + onSurface: Colors.white, + ), + dialogBackgroundColor: primaryColor, + ), + child: child!, + ); + }, + ); - payload["fasting"] = double.parse(fastingValueController.text.toString()); - payload["postPrandial"] = double.parse(postParandialValueController.text.toString()); + if (pickedDate != null) { + print( + pickedDate); //pickedDate output format => 2021-03-10 00:00:00.000 + String formattedDate = + DateFormat('dd-MM-yyyy').format(pickedDate); + print( + formattedDate); //formatted date output using intl package => 2021-03-16 + setState(() { + dateInput.text = + formattedDate; //set output date to TextField value. + }); + } else {} + }, + ), + ), + SizedBox(height: 10), + Container( + width: double.infinity, + height: + MediaQuery.of(context).size.height * .05, + child: ElevatedButton( + style: ElevatedButton.styleFrom( + primary: buttonColors, // background + onPrimary: Colors.black, // foreground + ), + onPressed: () async { + if (fastingValueController.text != '' && + postParandialValueController.text != ''&& dateInput.text!='') { + AppSettings.preLoaderDialog(context); + var payload = new Map(); - var value = await AppSettings.calculateSugar(payload); - var valueResponse = jsonDecode(value); - print(valueResponse); - setState(() { - sugarValue = valueResponse['userSugarDetails']['sugarCategory'].toString(); + payload["fasting"] = double.parse(fastingValueController.text.toString()); + payload["postPrandial"] = double.parse(postParandialValueController.text.toString()); + payload["date"] = dateInput.text.toString(); - }); - fastingValueController.clear(); - postParandialValueController.clear(); - Navigator.of(context,rootNavigator: true).pop(); - } - }, - ), + var value = await AppSettings.calculateSugar(payload); + var valueResponse = jsonDecode(value); + print(valueResponse); + setState(() { + sugarValue = valueResponse['userSugarDetails']['sugarCategory'].toString(); + + }); + fastingValueController.clear(); + postParandialValueController.clear(); + dateInput.clear(); + Navigator.of(context,rootNavigator: true).pop(); + } + else{ + AppSettings.longFailedToast('Please enter valid details'); + } + }, + child: const Text('Check Diabetes'), + )), SizedBox(height: 10), Container( child: Row( children: [ - Text(sugarValue,style: TextStyle(color: Colors.red),), + Text(sugarValue,style: TextStyle(color: Colors.red,fontWeight: FontWeight.bold,fontSize: 15),), ], ) ), diff --git a/lib/Sugar/sugar_history.dart b/lib/Sugar/sugar_history.dart index 9f73425..48c8410 100644 --- a/lib/Sugar/sugar_history.dart +++ b/lib/Sugar/sugar_history.dart @@ -1,9 +1,8 @@ import 'dart:convert'; import 'package:flutter/material.dart'; -import 'package:healthcare_user/models/bmi_history_model.dart'; import 'package:healthcare_user/common/settings.dart'; -import 'package:healthcare_user/models/bp_history_model.dart'; import 'package:healthcare_user/models/sugar_history_model.dart'; +import 'package:flutter_slidable/flutter_slidable.dart'; class SugarHistory extends StatefulWidget { const SugarHistory({Key? key}) : super(key: key); @@ -13,56 +12,51 @@ class SugarHistory extends StatefulWidget { } class _SugarHistoryState extends State { - - bool isLoading=false; + bool isLoading = false; List sugarHistoryList = []; List FilteredList = []; var dateItems = [ + 'All', 'last 7 days', 'last one month', 'last one year', ]; - var dateItemsVariable = 'last 7 days'; + var dateItemsVariable = 'All'; Future getSugarHistoryDetails(var selectedRange) async { - isLoading=true; - var response1= await AppSettings.getSugarHistory(); + isLoading = true; + var response1 = await AppSettings.getSugarHistory(); print(response1); setState(() { - sugarHistoryList = - ((jsonDecode(response1)) as List).map((dynamic model) { - return SugarHistoryModel.fromJson(model); - }).toList(); + sugarHistoryList = ((jsonDecode(response1)) as List).map((dynamic model) { + return SugarHistoryModel.fromJson(model); + }).toList(); var now = new DateTime.now(); var now_1w = now.subtract(Duration(days: 7)); - var now_1m = new DateTime(now.year, now.month-1, now.day); - var now_1y = new DateTime(now.year-1, now.month, now.day); + var now_1m = new DateTime(now.year, now.month - 1, now.day); + var now_1y = new DateTime(now.year - 1, now.month, now.day); - if(selectedRange.toString().toUpperCase()=='LAST 7 DAYS'){ - FilteredList=sugarHistoryList.where((product) { + if (selectedRange.toString().toUpperCase() == 'LAST 7 DAYS') { + FilteredList = sugarHistoryList.where((product) { final date = product.dateForFilter; return now_1w.isBefore(date); }).toList(); - } - else if(selectedRange.toString().toUpperCase()=='LAST ONE MONTH'){ - FilteredList=sugarHistoryList.where((product) { + } else if (selectedRange.toString().toUpperCase() == 'LAST ONE MONTH') { + FilteredList = sugarHistoryList.where((product) { final date = product.dateForFilter; return now_1m.isBefore(date); }).toList(); - } - else if(selectedRange.toString().toUpperCase()=='LAST ONE YEAR'){ - FilteredList=sugarHistoryList.where((product) { + } else if (selectedRange.toString().toUpperCase() == 'LAST ONE YEAR') { + FilteredList = sugarHistoryList.where((product) { final date = product.dateForFilter; return now_1y.isBefore(date); }).toList(); - } - else{ - FilteredList=sugarHistoryList; + } else { + FilteredList = sugarHistoryList; } - - isLoading=false; + isLoading = false; }); } @@ -72,192 +66,374 @@ class _SugarHistoryState extends State { super.initState(); } - Widget renderzUi(){ - if(sugarHistoryList.length!=0){ + deleteSugarRecord(sugarInfoId) async { + AppSettings.preLoaderDialog(context); + bool status = await AppSettings.deleteSugarDetails(sugarInfoId); - return Column( - crossAxisAlignment: CrossAxisAlignment.end, - children: [ - Padding(padding: EdgeInsets.fromLTRB(10, 10, 10, 10), - child: DropdownButtonFormField( - // Initial Value - value: dateItemsVariable, - isExpanded: true, - decoration: const InputDecoration( - prefixIcon: Icon( - Icons.calendar_month, - color: primaryColor, - ), - border: OutlineInputBorder( - borderSide: BorderSide(color: primaryColor)), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide(color: primaryColor), - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide(color: primaryColor), - ), - labelText: 'Units', - labelStyle: TextStyle( - color: greyColor, //<-- SEE HERE - ), - ), + if (status) { + Navigator.of(context, rootNavigator: true).pop(); - hint: Text('Units'), - // Down Arrow Icon - //icon: const Icon(Icons.keyboard_arrow_down), + AppSettings.longSuccessToast("BP record deleted successfully"); + await getSugarHistoryDetails(dateItemsVariable); + } else { + Navigator.of(context, rootNavigator: true).pop(); - // Array list of items - items: dateItems.map((String items) { - return DropdownMenuItem( - value: items, - child: Text( - items, - style: TextStyle( - fontSize: 16, - ), - textAlign: TextAlign.center, - )); - }).toList(), - // After selecting the desired option,it will - // change button value to selected value - onChanged: (String? newValue) { - setState(() { - dateItemsVariable = newValue!; - }); - getSugarHistoryDetails(dateItemsVariable); - }, - ),), + AppSettings.longFailedToast("BP record deletion failed"); + } + } + + Widget renderzUi() { + if (sugarHistoryList.length != 0) { + return Column(crossAxisAlignment: CrossAxisAlignment.end, children: [ + Padding( + padding: EdgeInsets.fromLTRB(10, 10, 10, 10), + child: DropdownButtonFormField( + // Initial Value + value: dateItemsVariable, + isExpanded: true, + decoration: const InputDecoration( + prefixIcon: Icon( + Icons.calendar_month, + color: primaryColor, + ), + border: OutlineInputBorder( + borderSide: BorderSide(color: primaryColor)), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide(color: primaryColor), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide(color: primaryColor), + ), + labelText: 'Select Date Range', + labelStyle: TextStyle( + color: greyColor, //<-- SEE HERE + ), + ), - Expanded(child:ListView.builder( - padding: EdgeInsets.all(0), + hint: Text('Units'), + // Down Arrow Icon + //icon: const Icon(Icons.keyboard_arrow_down), + + // Array list of items + items: dateItems.map((String items) { + return DropdownMenuItem( + value: items, + child: Text( + items, + style: TextStyle( + fontSize: 16, + ), + textAlign: TextAlign.center, + )); + }).toList(), + // After selecting the desired option,it will + // change button value to selected value + onChanged: (String? newValue) { + setState(() { + dateItemsVariable = newValue!; + }); + getSugarHistoryDetails(dateItemsVariable); + }, + ), + ), + Expanded( + child: ListView.builder( + padding: EdgeInsets.all(0), itemCount: FilteredList.length, itemBuilder: (BuildContext context, int index) { - return Card( + return Slidable( + key: const ValueKey(0), + endActionPane: ActionPane( + // A motion is a widget used to control how the pane animates. + motion: ScrollMotion(), - color: Colors.white, - child: Padding( - padding:EdgeInsets.all(8) , - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ + dragDismissible: false, + // A pane can dismiss the Slidable. + dismissible: DismissiblePane(onDismissed: () { + deleteSugarRecord(FilteredList[index].sugarInfoId); + }), - Column( + // All actions are defined in the children parameter. + children: [ + // A SlidableAction can have an icon and/or a label. + SlidableAction( + backgroundColor: Color(0xFFFE4A49), + foregroundColor: Colors.white, + icon: Icons.delete, + label: 'Delete', + onPressed: (BuildContext context) { + deleteSugarRecord(FilteredList[index].sugarInfoId); + }, + ), + ], + ), + child: Card( + color: Colors.white, + child: Padding( + padding: EdgeInsets.all(8), + child: + Row( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ - Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Image( - image: const AssetImage('images/height.png'), - height: 25, - width: 25, - fit: BoxFit.fill), - Padding(padding: EdgeInsets.all(5), - child: Text(FilteredList[index].fasting.toString().toUpperCase(),style: valuesTextStyle()),) - ], - ), - Row( + Column( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ - Image( - image: const AssetImage('images/height.png'), - height: 25, - width: 25, - fit: BoxFit.fill), - Padding(padding: EdgeInsets.all(5), - child: Text(FilteredList[index].postPrandial.toString().toUpperCase(),style: valuesTextStyle()),) - + Text( + 'Fasting Sugar Value', + style: labelTextStyle(), + ), + SizedBox(height:MediaQuery.of(context).size.height * .01,), + Text( + 'PostPrandial Sugar Value', + style: labelTextStyle(), + ), + SizedBox(height:MediaQuery.of(context).size.height * .01,), + Text( + 'Actual Sugar Value', + style: labelTextStyle(), + ), + SizedBox(height:MediaQuery.of(context).size.height * .01,), + Text( + 'Sugar Status', + style: labelTextStyle(), + ), + SizedBox(height:MediaQuery.of(context).size.height * .01,), + Text( + 'Date', + style: labelTextStyle(), + ), ], ), - Row( + SizedBox(width:MediaQuery.of(context).size.width * .01,), + Column( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ - Image( - image: const AssetImage('images/height.png'), - height: 25, - width: 25, - fit: BoxFit.fill), - Padding(padding: EdgeInsets.all(5), - child: Text(FilteredList[index].sugarValue.toString().toUpperCase(),style: valuesTextStyle()),) - + Text( + ':', + style: labelTextStyle(), + ), + SizedBox(height:MediaQuery.of(context).size.height * .01,), + Text( + ':', + style: labelTextStyle(), + ), + SizedBox(height:MediaQuery.of(context).size.height * .01,), + Text( + ':', + style: labelTextStyle(), + ), + SizedBox(height:MediaQuery.of(context).size.height * .01,), + Text( + ':', + style: labelTextStyle(), + ), + SizedBox(height:MediaQuery.of(context).size.height * .01,), + Text( + ':', + style: labelTextStyle(), + ), ], ), - Row( + SizedBox(width:MediaQuery.of(context).size.width * .01,), + Expanded(child: Column( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ - Image( - image: const AssetImage('images/height.png'), - height: 25, - width: 25, - fit: BoxFit.fill), - Padding(padding: EdgeInsets.all(5), - child: Text(FilteredList[index].sugartText.toString().toUpperCase(),style: valuesTextStyle()),) - + Text( + FilteredList[index] + .fasting + .toString() + .toUpperCase(), + style: valuesTextStyle()), + SizedBox(height:MediaQuery.of(context).size.height * .01,), + Text( + FilteredList[index] + .postPrandial + .toString() + .toUpperCase(), + style: valuesTextStyle()), + SizedBox(height:MediaQuery.of(context).size.height * .01,), + Text( + FilteredList[index] + .sugarValue + .toString() + .toUpperCase(), + style: valuesTextStyle()), + SizedBox(height:MediaQuery.of(context).size.height * .01,), + Text( + FilteredList[index] + .sugartText + .toString() + .toUpperCase(), + style: wrapTextStyleBlack()), + SizedBox(height:MediaQuery.of(context).size.height * .01,), + Text( + FilteredList[index] + .actualDate + .toString() + .toUpperCase(), + style: valuesTextStyle()), ], - ), - Row( + ),) + + + /*Column( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ - Image( - image: const AssetImage('images/date.png'), - height: 25, - width: 25, - fit: BoxFit.fill), - Padding(padding: EdgeInsets.all(5), - child: Text(FilteredList[index].displayDate.toString().toUpperCase(),style: valuesTextStyle()),) - + Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + *//*Image( + image: const AssetImage( + 'images/height.png'), + height: 25, + width: 25, + fit: BoxFit.fill),*//* + Text( + 'Fasting Sugar Value', + style: TextStyle(color: primaryColor), + ), + Padding( + padding: EdgeInsets.all(5), + child: Text( + FilteredList[index] + .fasting + .toString() + .toUpperCase(), + style: valuesTextStyle()), + ) + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Text( + 'PostPrandial Sugar Value', + style: TextStyle(color: primaryColor), + ), + Padding( + padding: EdgeInsets.all(5), + child: Text( + FilteredList[index] + .postPrandial + .toString() + .toUpperCase(), + style: valuesTextStyle()), + ) + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Image( + image: const AssetImage( + 'images/height.png'), + height: 25, + width: 25, + fit: BoxFit.fill), + Padding( + padding: EdgeInsets.all(5), + child: Text( + FilteredList[index] + .sugarValue + .toString() + .toUpperCase(), + style: valuesTextStyle()), + ) + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Image( + image: const AssetImage( + 'images/height.png'), + height: 25, + width: 25, + fit: BoxFit.fill), + Padding( + padding: EdgeInsets.all(5), + child: Text( + FilteredList[index] + .sugartText + .toString() + .toUpperCase(), + style: valuesTextStyle()), + ) + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Image( + image: const AssetImage( + 'images/date.png'), + height: 25, + width: 25, + fit: BoxFit.fill), + Padding( + padding: EdgeInsets.all(5), + child: Text( + FilteredList[index] + .actualDate + .toString() + .toUpperCase(), + style: valuesTextStyle()), + ) + ], + ), ], - ), - + ),*/ ], ), - - ], - - ), - ), - ); - }) ), - ]); - } - else{ - return Center( + ), + )); + })), + ]); + } else { + return Center( child: Padding( - padding: EdgeInsets.fromLTRB(0, 40, 0, 0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - SizedBox(height: MediaQuery.of(context).size.height * .25,), - Text('No data'), - SizedBox( - height: 20, - ), - CircleAvatar( - backgroundColor: primaryColor, - radius: 40, - child: IconButton( - iconSize: 40, - icon: const Icon( - Icons.info, - color: Colors.white, - ), - onPressed: () async { - - }, - ), - ) - ], + padding: EdgeInsets.fromLTRB(0, 40, 0, 0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + SizedBox( + height: MediaQuery.of(context).size.height * .25, + ), + Text('No data'), + SizedBox( + height: 20, ), - ) - ); + CircleAvatar( + backgroundColor: primaryColor, + radius: 40, + child: IconButton( + iconSize: 40, + icon: const Icon( + Icons.info, + color: Colors.white, + ), + onPressed: () async {}, + ), + ) + ], + ), + )); } } @@ -265,12 +441,14 @@ class _SugarHistoryState extends State { Widget build(BuildContext context) { return Scaffold( appBar: AppSettings.appBar('Diabetes'), - body: isLoading?Center( - child: CircularProgressIndicator( - color: primaryColor, - strokeWidth: 5.0, - ), - ):renderzUi(), + body: isLoading + ? Center( + child: CircularProgressIndicator( + color: primaryColor, + strokeWidth: 5.0, + ), + ) + : renderzUi(), ); } } diff --git a/lib/chart/bmi_chart.dart b/lib/chart/bmi_chart.dart index 18b162b..0f40fe0 100644 --- a/lib/chart/bmi_chart.dart +++ b/lib/chart/bmi_chart.dart @@ -20,7 +20,7 @@ class _BmiChartState extends State { _getSeriesData() { List> series = [ charts.Series( - id: "Sales", + id: "Bmi", data: widget.myObject, domainFn: (BmiHistoryModel series, _) => series.dateForFilter, measureFn: (BmiHistoryModel series, _) => series.number2, diff --git a/lib/common/dashboard.dart b/lib/common/dashboard.dart index 8118f18..78dde5f 100644 --- a/lib/common/dashboard.dart +++ b/lib/common/dashboard.dart @@ -10,8 +10,9 @@ import 'package:healthcare_user/medicines.dart'; import 'package:healthcare_user/my_health.dart'; import 'package:healthcare_user/my_medicine_timings.dart'; import 'package:healthcare_user/prescriptions/prescriptions.dart'; -import 'package:healthcare_user/report_my_self.dart'; +import 'package:healthcare_user/report_problem/report_my_self.dart'; import 'package:healthcare_user/Reports/add_reports.dart'; +import 'package:healthcare_user/report_problem/all_problems.dart'; import 'package:healthcare_user/seekopinion.dart'; import 'package:healthcare_user/common/settings.dart'; import 'package:healthcare_user/updates/update_location.dart'; @@ -371,19 +372,15 @@ class _DashboardState extends State { shape: BoxShape.circle, image: DecorationImage( image: AssetImage( - "images/invitations.png"), // picked file + "images/myconnections.png"), // picked file fit: BoxFit.fitWidth)), ), onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => const Invitations()), - ); + }, ), Text( - 'Invitations', + 'My Connections', style: dashboardTextStyle(), ), ], @@ -774,7 +771,7 @@ class _DashboardState extends State { Navigator.push( context, MaterialPageRoute( - builder: (context) => const ReportMySelf()), + builder: (context) => AllProblemsReportMyself()), ); }, ), @@ -785,7 +782,7 @@ class _DashboardState extends State { title: Row( children: [ Image( - image: const AssetImage('images/myconnections.png'), + image: const AssetImage('images/invitations.png'), height: 25, width: 25, fit: BoxFit.fill), @@ -795,10 +792,16 @@ class _DashboardState extends State { const SizedBox( width: 10, ), - Text('My Connections', style: drawerListItemsTextStyle()), + Text('Invitations', style: drawerListItemsTextStyle()), ], ), - onTap: () {}, + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => const Invitations()), + ); + }, ), Divider( color: Colors.grey, diff --git a/lib/common/settings.dart b/lib/common/settings.dart index 24fdcc6..c07e997 100644 --- a/lib/common/settings.dart +++ b/lib/common/settings.dart @@ -194,6 +194,28 @@ InputDecoration textFormFieldDecoration(IconData icon, var text) { ); } +InputDecoration textFormFieldDecorationBMI(IconData icon, var text) { + return InputDecoration( + //filled: true, + //fillColor: Colors.white, + prefixIcon: Icon( + icon, + color: primaryColor, + ), + border: OutlineInputBorder(borderSide: BorderSide(color: primaryColor)), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide(color: primaryColor), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide(color: primaryColor), + ), + labelText: text, + labelStyle: TextStyle( + //color: Colors.black, //<-- SEE HERE + ), + ); +} + final GlobalKey preloaderWindowKey = new GlobalKey(); Future preloaderWindow(BuildContext context) async { try { @@ -250,6 +272,7 @@ class AppSettings { static String getBpHistoryUrl = host + 'usersbp'; static String getSugarHistoryUrl = host + 'userssugar'; static String addMedicineTimingsUrl = host + 'medicine-timing'; + static String updateMedicineTimingsUrl = host + 'update-medicine-timing'; static String getMedicineTimingsUrl = host + 'getmedicineztiming'; static String findingsUploadPicUrl = host + 'uploads-findings-prescription'; static String addFindingsUrl = host + 'update-uploads-findingsPictureId-prescription'; @@ -268,6 +291,8 @@ class AppSettings { static String addRecordsUrl = host + 'add-record'; static String updateRecordsUrl = host + 'records'; static String reportMySelfVideoUploadUrl = host + 'reportProblemVideo'; + static String uploadReportMyselfPictureUrl = host + 'reportProblemPicture'; + //static String getAllPrescriptionsDataUrl = host + 'usersinglerprecription'; static String getAllPrescriptionsDataUrl = host + 'getAllPrescriptionDetails'; static String getRecordsDataUrl = host + 'getAllRecords'; @@ -276,6 +301,16 @@ class AppSettings { static String deletePrescriptionsUrl = host + 'delete-prescription'; static String deleteReportsUrl = host + 'delete-report'; static String deleteRecordsUrl = host + 'delete-url'; + static String deleteBMIDetailsUrl = host + 'deleteBMI'; + static String deleteBPDetailsUrl = host + 'deleteBP'; + static String deleteSugarDetailsUrl = host + 'deleteSugar'; + static String addReportMySelfProblemUrl = host + 'insertReport'; + static String getAllReportProblemDetalisUrl = host + 'userreport'; + static String deleteReportMySelfProblemUrl = host + 'deleteReportProblem'; + + + + @@ -1052,6 +1087,16 @@ class AppSettings { return response.body; } + + static Future uploadReportMyselfPicture(file) async { + + var request = http.MultipartRequest('POST', Uri.parse(uploadReportMyselfPictureUrl + '/' + customerId)); + request.files.add(await http.MultipartFile.fromPath('picture', file.path)); + var res = await request.send(); + var response = await http.Response.fromStream(res); + return response.body; + } + static Future getAllpharmacies() async { var uri = Uri.parse(getAllpharmaciesDataUrl); //uri = uri.replace(query: 'customerId=$customerId'); @@ -1125,6 +1170,31 @@ class AppSettings { } } + static Future updateMedicineTimings(payload) async { + var uri = Uri.parse(updateMedicineTimingsUrl + '/' + customerId); + + var response = await http.post(uri, + body: json.encode(payload), headers: await buildRequestHeaders()); + if (response.statusCode == 200) { + return response.body; + } else if (response.statusCode == 401) { + bool status = await AppSettings.resetToken(); + if (status) { + response = await http.post(uri, + body: json.encode(payload), headers: await buildRequestHeaders()); + if (response.statusCode == 200) { + return response.body; + } else { + return ''; + } + } else { + return ''; + } + } else { + return ''; + } + } + static Future getMedicineTimings() async { var uri = Uri.parse(getMedicineTimingsUrl + '/' + customerId); @@ -1473,7 +1543,6 @@ class AppSettings { } }*/ - static Future deleteRecords(payload, recordId) async { var uri = Uri.parse(deleteRecordsUrl + '/' + customerId+'/'+recordId); @@ -1503,8 +1572,6 @@ class AppSettings { } } - - static Future deleteRecordsNew(payload, recordId) async { var uri = Uri.parse(deleteRecordsUrl + '/' + customerId+'/'+recordId); @@ -1534,9 +1601,178 @@ class AppSettings { } } + static Future deleteBMIDetails(bmiId) async { + var uri = Uri.parse(deleteBMIDetailsUrl + '/' + customerId+'/'+ bmiId); + try { + var response = await http.delete(uri, headers: await buildRequestHeaders()); + if (response.statusCode == 200) { + return true; + } else if (response.statusCode == 401) { + bool status = await AppSettings.resetToken(); + if (status) { + response = await http.delete(uri, headers: await buildRequestHeaders()); + if (response.statusCode == 200) { + return true; + } else { + return false; + } + } else { + return false; + } + } else { + return false; + } + } catch (e) { + print(e); + return false; + } + } + static Future deleteBPDetails(bmiId) async { + var uri = Uri.parse(deleteBPDetailsUrl + '/' + customerId+'/'+ bmiId); + + try { + var response = await http.delete(uri, headers: await buildRequestHeaders()); + + if (response.statusCode == 200) { + return true; + } else if (response.statusCode == 401) { + bool status = await AppSettings.resetToken(); + if (status) { + response = await http.delete(uri, headers: await buildRequestHeaders()); + if (response.statusCode == 200) { + return true; + } else { + return false; + } + } else { + return false; + } + } else { + return false; + } + } catch (e) { + print(e); + return false; + } + } + + static Future deleteSugarDetails(bmiId) async { + var uri = Uri.parse(deleteSugarDetailsUrl + '/' + customerId+'/'+ bmiId); + + try { + var response = await http.delete(uri, headers: await buildRequestHeaders()); + + if (response.statusCode == 200) { + return true; + } else if (response.statusCode == 401) { + bool status = await AppSettings.resetToken(); + if (status) { + response = await http.delete(uri, headers: await buildRequestHeaders()); + if (response.statusCode == 200) { + return true; + } else { + return false; + } + } else { + return false; + } + } else { + return false; + } + } catch (e) { + print(e); + return false; + } + } + + + static Future addReportMySelfProblem(payload) async { + var uri = Uri.parse(addReportMySelfProblemUrl + '/' + customerId); + var response = await http.post(uri, + body: json.encode(payload), headers: await buildRequestHeaders()); + + if (response.statusCode == 200) { + try { + var _response = json.decode(response.body); + print(_response); + return true; + } catch (e) { + print(e); + return false; + } + } else if (response.statusCode == 401) { + bool status = await AppSettings.resetToken(); + if (status) { + response = await http.post(uri, + body: json.encode(payload), headers: await buildRequestHeaders()); + if (response.statusCode == 200) { + return true; + } else { + return false; + } + } else { + return false; + } + } else { + return false; + } + } + + static Future getAllReportProblemDetalis() async { + var uri = Uri.parse(getAllReportProblemDetalisUrl+'/'+customerId); + //uri = uri.replace(query: 'customerId=$customerId'); + + var response = await http.get(uri, headers: await buildRequestHeaders()); + if (response.statusCode == 200) { + return response.body; + } else if (response.statusCode == 401) { + bool status = await AppSettings.resetToken(); + if (status) { + response = await http.get(uri, headers: await buildRequestHeaders()); + if (response.statusCode == 200) { + return response.body; + } else { + return ''; + } + } else { + return ''; + } + } else { + return ''; + } + } + + static Future deleteReportMySelfProblem(problemId) async { + var uri = Uri.parse(deleteReportMySelfProblemUrl + '/' +problemId); + + try { + var response = await http.put (uri, headers: await buildPutRequestHeaders()); + + if (response.statusCode == 200) { + return true; + } else if (response.statusCode == 401) { + bool status = await AppSettings.resetToken(); + if (status) { + response = await http.put(uri, headers: await buildPutRequestHeaders()); + if (response.statusCode == 200) { + return true; + } else { + return false; + } + } else { + return false; + } + } else { + return false; + } + } catch (e) { + print(e); + return false; + } + } /*Apis ends here*/ diff --git a/lib/common/zoom_image.dart b/lib/common/zoom_image.dart index 5cc137a..a08a0d0 100644 --- a/lib/common/zoom_image.dart +++ b/lib/common/zoom_image.dart @@ -15,17 +15,43 @@ class _ImageZoomPageState extends State { @override Widget build(BuildContext context) { return Scaffold( - appBar: AppSettings.appBar(widget.imageName), + appBar:AppBar( + backgroundColor: primaryColor, + title: Text(widget.imageName), + actions: [ + IconButton( + onPressed: () { + + Navigator.pop(context); + }, + icon: Icon( + Icons.cancel, + color: Colors.red, + size: 30, + ), + ), + ], + ), body: Container( //width: MediaQuery.of(context).size.width * .10, //height: MediaQuery.of(context).size.height * .50, - child: PhotoView( - imageProvider: NetworkImage(widget.imageDetails) as ImageProvider, - maxScale: PhotoViewComputedScale.contained * 4.0, - minScale: PhotoViewComputedScale.contained, - initialScale: PhotoViewComputedScale.contained, - basePosition: Alignment.center, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding(padding:EdgeInsets.fromLTRB(10,10,10,0), + child: Text('Use two fingers to zoom/double tap',style: TextStyle(color: Colors.black,fontSize: 12),),), + SizedBox(height:MediaQuery.of(context).size.height * .02,), + Expanded( + child: PhotoView( + imageProvider: NetworkImage(widget.imageDetails) as ImageProvider, + maxScale: PhotoViewComputedScale.contained * 4.0, + minScale: PhotoViewComputedScale.contained, + initialScale: PhotoViewComputedScale.contained, + basePosition: Alignment.center, + ), + ) + ], ) ), diff --git a/lib/edit_medicine_timings.dart b/lib/edit_medicine_timings.dart index a33bdfc..d158974 100644 --- a/lib/edit_medicine_timings.dart +++ b/lib/edit_medicine_timings.dart @@ -1,15 +1,415 @@ +import 'dart:convert'; + import 'package:flutter/material.dart'; +import 'package:healthcare_user/common/settings.dart'; +import 'package:day_night_time_picker/day_night_time_picker.dart'; +import 'package:intl/intl.dart'; class EditMedicineTimings extends StatefulWidget { - const EditMedicineTimings({Key? key}) : super(key: key); + + var medicineTimings; + EditMedicineTimings({this.medicineTimings}); @override State createState() => _EditMedicineTimingsState(); } class _EditMedicineTimingsState extends State { + Time _time = Time(hour: 0, minute: 0, second: 0); + Time _wakeupTime = Time(hour: 0, minute: 0, second: 0); + Time _beforeBreakfastTime = Time(hour: 0, minute: 0, second: 0); + Time _afterBreakfastTime = Time(hour: 0, minute: 0, second: 0); + Time _beforeLunchTime = Time(hour: 0, minute: 0, second: 0); + Time _afterLunchTime = Time(hour: 0, minute: 0, second: 0); + Time _eveningTeaTime = Time(hour: 0, minute: 0, second: 0); + Time _beforeDinnerTime = Time(hour: 0, minute: 0, second: 0); + Time _afterDinnerTime = Time(hour: 0, minute: 0, second: 0); + Time _sleepTime = Time(hour: 0, minute: 0, second: 0); + DateTime wakeUp = DateTime.now(); + + String wakeUpfForApi=''; + String _beforeBreakfastTimeForApi=''; + String _afterBreakfastTimeForApi=''; + String _beforeLunchTimeForApi=''; + String _afterLunchTimeForApi=''; + String _eveningTeaTimeForApi=''; + String _beforeDinnerTimeForApi=''; + String _afterDinnerTimeForApi=''; + String _sleepTimeForApi=''; + + List timings = [ + {'name': 'Wakeup'}, + {'name': 'Before breakfast'}, + {'name': 'After- breakfast'}, + {'name': 'Before lunch'}, + {'name': 'After lunch'}, + {'name': 'Evening tea'}, + {'name': 'Before dinner'}, + {'name': 'After dinner'}, + {'name': 'Sleep'} + ]; + + @override + void initState() { + + wakeUpfForApi=widget.medicineTimings['wakeUp']; + _beforeBreakfastTimeForApi=widget.medicineTimings['beforeBreakfast']; + _afterBreakfastTimeForApi=widget.medicineTimings['afterBreakfast']; + _beforeLunchTimeForApi=widget.medicineTimings['beforeLunch']; + _afterLunchTimeForApi=widget.medicineTimings['afterLunch']; + _eveningTeaTimeForApi=widget.medicineTimings['eveningTea']; + _beforeDinnerTimeForApi=widget.medicineTimings['beforeDinner']; + _afterDinnerTimeForApi=widget.medicineTimings['afterDinner']; + _sleepTimeForApi=widget.medicineTimings['sleep']; + + + super.initState(); + } + + + Widget textForSelectedTime(int index) { + if (index == 0) { + return + Text( + wakeUpfForApi, + style: TextStyle(color: Colors.black), + ); + } else if (index == 1) { + return Text( + _beforeBreakfastTimeForApi, + style: TextStyle(color: Colors.black), + ); + } else if (index == 2) { + return Text( + _afterBreakfastTimeForApi, + style: TextStyle(color: Colors.black), + ); + } else if (index == 3) { + return Text( + _beforeLunchTimeForApi, + style: TextStyle(color: Colors.black), + ); + } else if (index == 4) { + return Text( + _afterLunchTimeForApi, + style: TextStyle(color: Colors.black), + ); + } else if (index == 5) { + return Text( + _eveningTeaTimeForApi, + style: TextStyle(color: Colors.black), + ); + } else if (index == 6) { + return Text( + _beforeDinnerTimeForApi, + style: TextStyle(color: Colors.black), + ); + } else if (index == 7) { + return Text( + _afterDinnerTimeForApi, + style: TextStyle(color: Colors.black), + ); + } else if (index == 8) { + return Text( + _sleepTimeForApi, + style: TextStyle(color: Colors.black), + ); + } else { + return Container(); + } + } + + void onTimeChanged(Time newTime, int index) { + setState(() { + _time=newTime; + }); + if (index == 0) { + setState(() { + _wakeupTime = newTime; + }); + final now = new DateTime.now(); + final dt = DateTime(now.year, now.month, now.day, _wakeupTime.hour, _wakeupTime.minute); + final format = DateFormat.jm(); + setState(() { + wakeUpfForApi=format.format(dt); + }); + } + else if (index == 1) { + setState(() { + _beforeBreakfastTime = newTime; + }); + final now = new DateTime.now(); + final dt = DateTime(now.year, now.month, now.day, _beforeBreakfastTime.hour, _beforeBreakfastTime.minute); + final format = DateFormat.jm(); + setState(() { + _beforeBreakfastTimeForApi=format.format(dt); + }); + } + else if (index == 2) { + setState(() { + _afterBreakfastTime = newTime; + }); + final now = new DateTime.now(); + final dt = DateTime(now.year, now.month, now.day, _afterBreakfastTime.hour, _afterBreakfastTime.minute); + final format = DateFormat.jm(); + setState(() { + _afterBreakfastTimeForApi=format.format(dt); + }); + } + else if (index == 3) { + setState(() { + _beforeLunchTime = newTime; + }); + final now = new DateTime.now(); + final dt = DateTime(now.year, now.month, now.day, _beforeLunchTime.hour, _beforeLunchTime.minute); + final format = DateFormat.jm(); + setState(() { + _beforeLunchTimeForApi=format.format(dt); + }); + } + else if (index == 4) { + setState(() { + _afterLunchTime = newTime; + }); + final now = new DateTime.now(); + final dt = DateTime(now.year, now.month, now.day, _afterLunchTime.hour, _afterLunchTime.minute); + final format = DateFormat.jm(); + setState(() { + _afterLunchTimeForApi=format.format(dt); + }); + } + else if (index == 5) { + setState(() { + _eveningTeaTime = newTime; + }); + final now = new DateTime.now(); + final dt = DateTime(now.year, now.month, now.day, _eveningTeaTime.hour, _eveningTeaTime.minute); + final format = DateFormat.jm(); + setState(() { + _eveningTeaTimeForApi=format.format(dt); + }); + } + else if (index == 6) { + setState(() { + _beforeDinnerTime = newTime; + }); + final now = new DateTime.now(); + final dt = DateTime(now.year, now.month, now.day, _beforeDinnerTime.hour, _beforeDinnerTime.minute); + final format = DateFormat.jm(); + setState(() { + _beforeDinnerTimeForApi=format.format(dt); + }); + } + else if (index == 7) { + setState(() { + _afterDinnerTime = newTime; + }); + final now = new DateTime.now(); + final dt = DateTime(now.year, now.month, now.day, _afterDinnerTime.hour, _afterDinnerTime.minute); + final format = DateFormat.jm(); + setState(() { + _afterDinnerTimeForApi=format.format(dt); + }); + } + else if (index == 8) { + setState(() { + _sleepTime = newTime; + }); + final now = new DateTime.now(); + final dt = DateTime(now.year, now.month, now.day, _sleepTime.hour, _sleepTime.minute); + final format = DateFormat.jm(); + setState(() { + _sleepTimeForApi=format.format(dt); + }); + } + } + + void _selectedDateWithTime(DateTime newTime,int ind){ + if (ind == 0) { + setState(() { + wakeUp = newTime; + String formattedDate = DateFormat('yyyy-MM-dd – kk:mm').format(wakeUp); + // DateTime parseDate = new DateFormat("dd-MM-yyyy HH:mm:ss").parse(wakeUp); + print(formattedDate); + }); + } + /* else if (ind == 1) { + setState(() { + _beforeBreakfastTime = newTime as Time ; + }); + } + else if (ind == 2) { + setState(() { + _afterBreakfastTime = newTime as Time; + }); + } + else if (ind == 3) { + setState(() { + _beforeLunchTime = newTime as Time; + }); + } + else if (ind == 4) { + setState(() { + _afterLunchTime = newTime as Time; + }); + } + else if (ind == 5) { + setState(() { + _eveningTeaTime = newTime as Time; + }); + } + else if (ind == 6) { + setState(() { + _beforeDinnerTime = newTime as Time; + }); + } + else if (ind == 7) { + setState(() { + _afterDinnerTime = newTime as Time; + }); + } + else if (ind == 8) { + setState(() { + _sleepTime = newTime as Time; + }); + }*/ + + } + + + Widget renderTimings(){ + return Column( + children: [ + Expanded( + child: ListView.separated( + separatorBuilder: (context, index) => const Divider( + height: 4.0, + color: primaryColor, + ), + //padding: EdgeInsets.all(8), + itemCount: timings.length, + itemBuilder: (BuildContext context, int index) { + return Padding( + padding: EdgeInsets.all(10), + child: Container( + padding: EdgeInsets.fromLTRB(8, 8, 0, 0), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Container( + width: + MediaQuery.of(context).size.width * .40, + child: Text( + timings[index]['name'], + style: wrapTextStyle(), + ), + ), + GestureDetector( + onTap: () { + Navigator.of(context).push( + showPicker( + showSecondSelector: true, + context: context, + value: _time, + //onChange: onTimeChanged, + onChange: (val) { + onTimeChanged(val, index); + }, + is24HrFormat: false, + sunrise: TimeOfDay( + hour: 6, minute: 0), // optional + sunset: TimeOfDay(hour: 18, minute: 0), + minuteInterval: TimePickerInterval.FIVE, + // Optional onChange to receive value as DateTime + onChangeDateTime: (DateTime dateTime) { + + _selectedDateWithTime(dateTime,index); + }, + ), + ); + }, + child: Image( + image: AssetImage('images/time.png'), + width: 30, + height: 30, + ), + ), + textForSelectedTime(index) + ], + ), + ], + )), + ); + })), + Padding(padding: EdgeInsets.fromLTRB(10, 10, 10, 40), + child: Row( + children: [ + ElevatedButton( + style: ElevatedButton.styleFrom( + primary: primaryColor, // background + onPrimary: Colors.white, // foreground + ), + onPressed: () async { + + AppSettings.preLoaderDialog(context); + + bool isOnline = await AppSettings.internetConnectivity(); + if(isOnline){ + if(_time!=TimeOfDay(hour: 0,minute: 0)){ + + + var payload = new Map(); + payload["wakeUp"] = wakeUpfForApi;//_wakeupTime.hour.toString()+':'+_wakeupTime.minute.toString(); + payload["beforeBreakfast"] = _beforeBreakfastTimeForApi; + payload["afterBreakfast"] = _afterBreakfastTimeForApi; + payload["beforeLunch"] = _beforeLunchTimeForApi; + payload["afterLunch"] = _afterLunchTimeForApi; + payload["eveningTea"] = _eveningTeaTimeForApi; + payload["beforeDinner"] = _beforeDinnerTimeForApi; + payload["afterDinner"] = _afterDinnerTimeForApi; + payload["sleep"] = _sleepTimeForApi; + + var value = await AppSettings.updateMedicineTimings(payload); + var valueResponse = jsonDecode(value); + + Navigator.of(context,rootNavigator: true).pop(); + Navigator.pop(context); + //getMedicineTimingsList(); + } + else{ + Navigator.of(context,rootNavigator: true).pop(); + AppSettings.longFailedToast('Please select timing' ); + } + + } + else{ + Navigator.of(context,rootNavigator: true).pop(); + AppSettings.longFailedToast('Please check internet' ); + } + + }, + child: const Text('Update'), + ), + ], + ) + ) + ], + ); + } + + @override Widget build(BuildContext context) { - return const Placeholder(); + return Scaffold( + appBar: AppSettings.appBar('Edit Medicine Timings'), + body: Container( + child: //Text(widget.medicineTimings.toString()) + renderTimings(), + ) + //medicineTimings.length==0?renderUi():renderTimings(), + ); } } diff --git a/lib/howareufeeling_today.dart b/lib/howareufeeling_today.dart index 0a84392..44a1417 100644 --- a/lib/howareufeeling_today.dart +++ b/lib/howareufeeling_today.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; import 'package:healthcare_user/common/settings.dart'; -import 'package:healthcare_user/report_my_self.dart'; +import 'package:healthcare_user/report_problem/report_my_self.dart'; class HowAreYouFellingToday extends StatefulWidget { @@ -18,21 +18,179 @@ class _HowAreYouFellingTodayState extends State { body: Container( child: Padding( padding: EdgeInsets.all(10), - child: TextButton( - child: const Text( - 'Report a problem!', - style: TextStyle(fontSize: 15, - decoration: TextDecoration.underline,color: greyColor), - ), - onPressed: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => const ReportMySelf()), - ); - //signup screen - }, - ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + /*TextButton( + child: const Text( + 'Report a problem!', + style: TextStyle(fontSize: 15, + decoration: TextDecoration.underline,color: greyColor), + ), + onPressed: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => const ReportMySelf()), + ); + //signup screen + }, + ),*/ + Row( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Column( + children: [ + GestureDetector( + child: Container( + width: MediaQuery.of(context).size.width * .20, + height: MediaQuery.of(context).size.height * .15, + decoration: BoxDecoration( + color: Colors.white, + shape: BoxShape.circle, + image: DecorationImage( + image: AssetImage( + "images/happy.png"), // picked file + fit: BoxFit.fitWidth)), + ), + onTap: () { + + }, + ), + Text('Happy', style: TextStyle(color: primaryColor,fontSize: 14,fontWeight: FontWeight.bold),) + ], + ), + Column( + children: [ + GestureDetector( + child: Container( + width: MediaQuery.of(context).size.width * .20, + height: MediaQuery.of(context).size.height * .15, + decoration: BoxDecoration( + color: Colors.white, + shape: BoxShape.circle, + image: DecorationImage( + image: AssetImage( + "images/ok.png"), // picked file + fit: BoxFit.fitWidth)), + ), + onTap: () async { + showDialog( + //barrierDismissible: false, + context: context, + builder: (BuildContext context) => AlertDialog( + title: const Text('Would you like to leave a message?', + style: TextStyle( + color: primaryColor, + fontSize: 20, + )), + actionsAlignment: MainAxisAlignment.spaceBetween, + actions: [ + TextButton( + onPressed: ()async { + Navigator.pop(context); + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => const ReportMySelf()), + ); + + + }, + child: const Text('Yes', + style: TextStyle( + color: primaryColor, + fontSize: 20, + )), + ), + TextButton( + onPressed: () { + Navigator.of(context).pop(true); + }, + child: const Text('No', + style: TextStyle( + color: primaryColor, + fontSize: 20, + )), + ), + ], + ), + ); + }, + ), + + Text('Ok', style: TextStyle(color: buttonColors,fontSize: 14,fontWeight: FontWeight.bold),) + ], + ), + Column( + children: [ + + GestureDetector( + child: + Container( + width: MediaQuery.of(context).size.width * .20, + height: MediaQuery.of(context).size.height * .15, + decoration: BoxDecoration( + color: Colors.white, + shape: BoxShape.circle, + image: DecorationImage( + image: AssetImage( + "images/sad.png"), // picked file + fit: BoxFit.fitWidth)), + ), + onTap: () async { + showDialog( + //barrierDismissible: false, + context: context, + builder: (BuildContext context) => AlertDialog( + title: const Text('Would you like to leave a message?', + style: TextStyle( + color: primaryColor, + fontSize: 20, + )), + actionsAlignment: MainAxisAlignment.spaceBetween, + actions: [ + TextButton( + onPressed: ()async { + Navigator.pop(context); + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => const ReportMySelf()), + ); + + + }, + child: const Text('Yes', + style: TextStyle( + color: primaryColor, + fontSize: 20, + )), + ), + TextButton( + onPressed: () { + Navigator.of(context).pop(true); + }, + child: const Text('No', + style: TextStyle( + color: primaryColor, + fontSize: 20, + )), + ), + ], + ), + ); + }, + ), + Text('Sick', style: TextStyle(color: Colors.red,fontSize: 14,fontWeight: FontWeight.bold),) + ], + ), + ], + ) + ], + ) ), ), ); diff --git a/lib/invitations/invitations.dart b/lib/invitations/invitations.dart index 0f00666..3339308 100644 --- a/lib/invitations/invitations.dart +++ b/lib/invitations/invitations.dart @@ -75,7 +75,7 @@ class _InvitationsState extends State { - payload["name"] = nameController.text; + payload["name"] = AppSettings.userName; payload["phone"] = mobileNumberController.text; payload["dateAndTime"] = formattedDate; bool invitationStatus = await AppSettings.inviteFriend(payload); @@ -148,7 +148,7 @@ class _InvitationsState extends State { } } - payload["name"] =_contact!.fullName; + payload["name"] =AppSettings.userName; payload["phone"] = stringAfterRemovingWhiteSpace; payload["dateAndTime"] = formattedDate; bool invitationStatus = await AppSettings.inviteFriend(payload); diff --git a/lib/models/all_problems_model.dart b/lib/models/all_problems_model.dart new file mode 100644 index 0000000..0904ca3 --- /dev/null +++ b/lib/models/all_problems_model.dart @@ -0,0 +1,33 @@ +import 'package:intl/intl.dart'; + +class AllProblemsModel { + String problem=''; + String audio=''; + String description=''; + String video=''; + String date=''; + String problemId=''; + List picture = []; + String image=''; + bool isAudioButtonEnabled=false; + DateTime dateForFilter=new DateTime.now(); + String dateNew=''; + + AllProblemsModel(); + + factory AllProblemsModel.fromJson(Map json){ + AllProblemsModel rtvm = new AllProblemsModel(); + + rtvm.problem = json['name'] ?? ''; + rtvm.audio = json['audio'] ?? ''; + rtvm.description = json['description'] ?? ''; + rtvm.video = json['video'] ?? ''; + rtvm.date = json['date'] ?? ''; + rtvm.dateForFilter = DateFormat('dd-MM-yyyy').parse(rtvm.date); + rtvm.problemId = json['reportId'] ?? ''; + rtvm.picture = json['picture'] ?? []; + rtvm.image=json['picture'][0]['url']??''; + return rtvm; + } + +} \ No newline at end of file diff --git a/lib/models/bmi_history_model.dart b/lib/models/bmi_history_model.dart index a2c10c2..efe27fc 100644 --- a/lib/models/bmi_history_model.dart +++ b/lib/models/bmi_history_model.dart @@ -1,4 +1,3 @@ -import 'package:flutter/material.dart'; import 'package:intl/intl.dart'; @@ -7,8 +6,11 @@ class BmiHistoryModel { String height= ''; String weight= ''; String date= ''; + String actualDate= ''; String displayDate=''; DateTime dateForFilter=new DateTime.now(); + String bmiInfoId = ''; + String bmiText = ''; var number1; var number2; @@ -18,7 +20,7 @@ class BmiHistoryModel { factory BmiHistoryModel.fromJson(Map json){ BmiHistoryModel rtvm = new BmiHistoryModel(); /*"heightUnit": "feet", - "weightUnit": "kg", + "weightUnit": "kg",oh "_id": "6493fe48eca67b71b8444e24", "bmiinfoid": "BMI1687420488845468", "customerId": "AHSUSNE2", @@ -30,18 +32,26 @@ class BmiHistoryModel { "updatedAt": "2023-06-22T07:54:48.847Z",*/ rtvm.bmiValue = json['bmivalue'].toString() ?? ''; + rtvm.bmiInfoId = json['bmiinfoid'].toString() ?? ''; rtvm.height = json['height'].toString() ?? ''; rtvm.weight = json['weight'].toString() ?? ''; rtvm.number1 = double.parse( rtvm.bmiValue); rtvm.number2 = double.parse( rtvm.bmiValue); rtvm.date = json['createdAt'].toString() ?? ''; - - //DateTime tempDate = new DateFormat("yyyy-MM-dd hh:mm:ss").parse(rtvm.date); - DateTime parseDate = new DateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").parse(rtvm.date); - var outputFormat = DateFormat('MM/dd/yyyy hh:mm a'); - rtvm.dateForFilter=parseDate; - var outputDate = outputFormat.format(parseDate); - rtvm.displayDate=outputDate; + rtvm.actualDate = json['date'].toString() ?? ''; + rtvm.dateForFilter = DateFormat('dd-MM-yyyy').parse(rtvm.actualDate); + if(double.parse(rtvm.bmiValue)<18.5){ + rtvm.bmiText='Underweight'; + } + else if(double.parse(rtvm.bmiValue)>=18.5&&double.parse(rtvm.bmiValue)<=24.9){ + rtvm.bmiText='Normal weight'; + } + else if(double.parse(rtvm.bmiValue)>=25&&double.parse(rtvm.bmiValue)<=29.9){ + rtvm.bmiText='Overweight'; + } + else if(double.parse(rtvm.bmiValue)>=30){ + rtvm.bmiText='Obesity'; + } return rtvm; diff --git a/lib/models/bp_history_model.dart b/lib/models/bp_history_model.dart index 716e39d..49ab801 100644 --- a/lib/models/bp_history_model.dart +++ b/lib/models/bp_history_model.dart @@ -7,7 +7,9 @@ class BPHistoryModel { String systolic= ''; String diastolic= ''; String date= ''; + String bpId= ''; String displayDate=''; + String actualDate=''; DateTime dateForFilter=new DateTime.now(); @@ -15,29 +17,15 @@ class BPHistoryModel { factory BPHistoryModel.fromJson(Map json){ BPHistoryModel rtvm = new BPHistoryModel(); - /*"heightUnit": "feet", - "weightUnit": "kg", - "_id": "6493fe48eca67b71b8444e24", - "bmiinfoid": "BMI1687420488845468", - "customerId": "AHSUSNE2", - "height": "164.592", - "weight": "50", - "age": 27, - "bmivalue": 18.46, - "createdAt": "2023-06-22T07:54:48.847Z", - "updatedAt": "2023-06-22T07:54:48.847Z",*/ rtvm.bpText = json['bpCategory'].toString() ?? ''; rtvm.systolic = json['Systolic'].toString() ?? ''; rtvm.diastolic = json['Diastolic'].toString() ?? ''; rtvm.date = json['createdAt'].toString() ?? ''; + rtvm.actualDate = json['date'].toString() ?? ''; + rtvm.bpId= json['bpinfoid'].toString() ?? ''; - //DateTime tempDate = new DateFormat("yyyy-MM-dd hh:mm:ss").parse(rtvm.date); - DateTime parseDate = new DateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").parse(rtvm.date); - var outputFormat = DateFormat('MM/dd/yyyy hh:mm a'); - rtvm.dateForFilter=parseDate; - var outputDate = outputFormat.format(parseDate); - rtvm.displayDate=outputDate; + rtvm.dateForFilter = DateFormat('dd-MM-yyyy').parse(rtvm.actualDate); return rtvm; diff --git a/lib/models/sugar_history_model.dart b/lib/models/sugar_history_model.dart index e3dfe6c..d977bab 100644 --- a/lib/models/sugar_history_model.dart +++ b/lib/models/sugar_history_model.dart @@ -9,6 +9,8 @@ class SugarHistoryModel { String postPrandial= ''; String date= ''; String displayDate=''; + String actualDate=''; + String sugarInfoId=''; DateTime dateForFilter=new DateTime.now(); @@ -16,30 +18,18 @@ class SugarHistoryModel { factory SugarHistoryModel.fromJson(Map json){ SugarHistoryModel rtvm = new SugarHistoryModel(); - /*"heightUnit": "feet", - "weightUnit": "kg", - "_id": "6493fe48eca67b71b8444e24", - "bmiinfoid": "BMI1687420488845468", - "customerId": "AHSUSNE2", - "height": "164.592", - "weight": "50", - "age": 27, - "bmivalue": 18.46, - "createdAt": "2023-06-22T07:54:48.847Z", - "updatedAt": "2023-06-22T07:54:48.847Z",*/ + rtvm.sugartText = json['sugarCategory'].toString() ?? ''; rtvm.sugarValue = json['sugarValue'].toString() ?? ''; rtvm.fasting = json['fasting'].toString() ?? ''; rtvm.postPrandial = json['postPrandial'].toString() ?? ''; rtvm.date = json['createdAt'].toString() ?? ''; + rtvm.actualDate = json['date'].toString() ?? ''; + rtvm.sugarInfoId = json['sugarinfoid'].toString() ?? ''; //DateTime tempDate = new DateFormat("yyyy-MM-dd hh:mm:ss").parse(rtvm.date); - DateTime parseDate = new DateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").parse(rtvm.date); - var outputFormat = DateFormat('MM/dd/yyyy hh:mm a'); - rtvm.dateForFilter=parseDate; - var outputDate = outputFormat.format(parseDate); - rtvm.displayDate=outputDate; + rtvm.dateForFilter = DateFormat('dd-MM-yyyy').parse(rtvm.actualDate); return rtvm; diff --git a/lib/my_health.dart b/lib/my_health.dart index 991a372..90913ad 100644 --- a/lib/my_health.dart +++ b/lib/my_health.dart @@ -422,68 +422,74 @@ class _MyHealthState extends State { ], ), )), - Card( + Visibility( + visible: false, + child: Card( child: Padding( - padding: EdgeInsets.all(3), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Container( - width: MediaQuery.of(context).size.width * .30, - child: Text('Cholesterol'), ), + padding: EdgeInsets.all(3), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Container( + width: MediaQuery.of(context).size.width * .30, + child: Text('Cholesterol'), ), - IconButton( - onPressed: () {}, - icon: Icon( - Icons.add, - color: greyColor, - ), - ) - ], - ), - )), - Card( - child: Padding( - padding: EdgeInsets.all(3), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Container( - width: MediaQuery.of(context).size.width * .30, - child: Text('Habbits'), + IconButton( + onPressed: () {}, + icon: Icon( + Icons.add, + color: greyColor, + ), + ) + ], ), - - IconButton( - onPressed: () {}, - icon: Icon( - Icons.add, - color: greyColor, - ), - ) - ], - ), - )), - Card( + )),), + Visibility( + visible: false, + child: Card( child: Padding( - padding: EdgeInsets.all(3), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Container( - width: MediaQuery.of(context).size.width * .30, - child: Text('Allergies'), + padding: EdgeInsets.all(3), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Container( + width: MediaQuery.of(context).size.width * .30, + child: Text('Habbits'), + ), + + IconButton( + onPressed: () {}, + icon: Icon( + Icons.add, + color: greyColor, + ), + ) + ], ), + ))), + Visibility( + visible: false, + child: Card( + child: Padding( + padding: EdgeInsets.all(3), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Container( + width: MediaQuery.of(context).size.width * .30, + child: Text('Allergies'), + ), - IconButton( - onPressed: () {}, - icon: Icon( - Icons.add, - color: greyColor, - ), - ) - ], - ), - )) + IconButton( + onPressed: () {}, + icon: Icon( + Icons.add, + color: greyColor, + ), + ) + ], + ), + ))) ], ), ), diff --git a/lib/my_medicine_timings.dart b/lib/my_medicine_timings.dart index 30c06c0..b76c879 100644 --- a/lib/my_medicine_timings.dart +++ b/lib/my_medicine_timings.dart @@ -1,4 +1,5 @@ import 'dart:convert'; +import 'package:healthcare_user/edit_medicine_timings.dart'; import 'package:intl/intl.dart'; import 'package:flutter/material.dart'; import 'package:healthcare_user/common/settings.dart'; @@ -321,38 +322,43 @@ class _MyMedicineTimingsState extends State { //padding: EdgeInsets.all(8), itemCount: timings.length, itemBuilder: (BuildContext context, int index) { - return Padding( - padding: EdgeInsets.all(10), - child: Container( - padding: EdgeInsets.fromLTRB(8, 8, 0, 0), - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - children: [ - Container( - width: - MediaQuery.of(context).size.width * .40, - child: Text( - timings[index]['name'], - style: wrapTextStyle(), + return GestureDetector( + onTap: (){ + AppSettings.longSuccessToast('Please click on edit button'); + }, + child: Padding( + padding: EdgeInsets.all(10), + child: Container( + padding: EdgeInsets.fromLTRB(8, 8, 0, 0), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Container( + width: + MediaQuery.of(context).size.width * .40, + child: Text( + timings[index]['name'], + style: wrapTextStyle(), + ), ), - ), - GestureDetector( - onTap: () { - }, - child: Image( - image: AssetImage('images/time.png'), - width: 30, - height: 30, + GestureDetector( + onTap: () { + }, + child: Image( + image: AssetImage('images/time.png'), + width: 30, + height: 30, + ), ), - ), - textForSelectedTime(index) - ], - ), - ], - )), + textForSelectedTime(index) + ], + ), + ], + )), + ), ); })), Padding(padding: EdgeInsets.fromLTRB(10, 10, 10, 40), @@ -365,10 +371,14 @@ class _MyMedicineTimingsState extends State { ), onPressed: () async { - editTimingsDialog(); - /*Navigator.push(context, MaterialPageRoute(builder: (context) => EditMedicineTimings())).then((value) { + //editTimingsDialog(); + + Navigator.push( + context, + new MaterialPageRoute( + builder: (__) => new EditMedicineTimings(medicineTimings:medicineTimings,))).then((value) { getMedicineTimingsList(); - });*/ + }); }, child: const Text('Edit'), ), @@ -616,265 +626,6 @@ class _MyMedicineTimingsState extends State { return Scaffold( appBar: AppSettings.appBar('My medicine timings'), body: medicineTimings.length==0?renderUi():renderTimings(), - /*Container( - child: Padding( - padding: EdgeInsets.all(10), - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - - Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox(height: 10,), - Text('Wakeup'), - SizedBox(height: 10,), - Text('Before breakfast'), - SizedBox(height: 15,), - Text('After breakfast'), - SizedBox(height: 15,), - Text('Before lunch'), - SizedBox(height: 15,), - Text('After lunch'), - SizedBox(height: 15,), - Text('Evening Tea'), - SizedBox(height: 15,), - Text('Before dinner'), - SizedBox(height: 15,), - Text('After dinner'), - SizedBox(height: 15,), - Text('Sleep'), - ], - ), - Column( - children: [ - GestureDetector( - onTap: (){ - Navigator.of(context).push( - showPicker( - showSecondSelector: true, - context: context, - value: _time, - onChange: onTimeChanged, - minuteInterval: TimePickerInterval.FIVE, - // Optional onChange to receive value as DateTime - onChangeDateTime: (DateTime dateTime) { - - // print(dateTime); - debugPrint("[debug datetime]: $dateTime"); - }, - ), - ); - }, - child: Image( - image: AssetImage('images/time.png'), - width: 30, - height: 30, - ), - ), - GestureDetector( - onTap: (){ - Navigator.of(context).push( - showPicker( - showSecondSelector: true, - context: context, - value: _time, - onChange: onTimeChanged, - minuteInterval: TimePickerInterval.FIVE, - // Optional onChange to receive value as DateTime - onChangeDateTime: (DateTime dateTime) { - // print(dateTime); - debugPrint("[debug datetime]: $dateTime"); - }, - ), - ); - }, - child: Image( - image: AssetImage('images/time.png'), - width: 30, - height: 30, - ), - ), - GestureDetector( - onTap: (){ - Navigator.of(context).push( - showPicker( - showSecondSelector: true, - context: context, - value: _time, - onChange: onTimeChanged, - minuteInterval: TimePickerInterval.FIVE, - // Optional onChange to receive value as DateTime - onChangeDateTime: (DateTime dateTime) { - // print(dateTime); - debugPrint("[debug datetime]: $dateTime"); - }, - ), - ); - }, - child: Image( - image: AssetImage('images/time.png'), - width: 30, - height: 30, - ), - ), - GestureDetector( - onTap: (){ - Navigator.of(context).push( - showPicker( - showSecondSelector: true, - context: context, - value: _time, - onChange: onTimeChanged, - minuteInterval: TimePickerInterval.FIVE, - // Optional onChange to receive value as DateTime - onChangeDateTime: (DateTime dateTime) { - // print(dateTime); - debugPrint("[debug datetime]: $dateTime"); - }, - ), - ); - }, - child: Image( - image: AssetImage('images/time.png'), - width: 30, - height: 30, - ), - ), - GestureDetector( - onTap: (){ - Navigator.of(context).push( - showPicker( - showSecondSelector: true, - context: context, - value: _time, - onChange: onTimeChanged, - minuteInterval: TimePickerInterval.FIVE, - // Optional onChange to receive value as DateTime - onChangeDateTime: (DateTime dateTime) { - // print(dateTime); - debugPrint("[debug datetime]: $dateTime"); - }, - ), - ); - }, - child: Image( - image: AssetImage('images/time.png'), - width: 30, - height: 30, - ), - ), - GestureDetector( - onTap: (){ - Navigator.of(context).push( - showPicker( - showSecondSelector: true, - context: context, - value: _time, - onChange: onTimeChanged, - minuteInterval: TimePickerInterval.FIVE, - // Optional onChange to receive value as DateTime - onChangeDateTime: (DateTime dateTime) { - // print(dateTime); - debugPrint("[debug datetime]: $dateTime"); - }, - ), - ); - }, - child: Image( - image: AssetImage('images/time.png'), - width: 30, - height: 30, - ), - ), - GestureDetector( - onTap: (){ - Navigator.of(context).push( - showPicker( - showSecondSelector: true, - context: context, - value: _time, - onChange: onTimeChanged, - minuteInterval: TimePickerInterval.FIVE, - // Optional onChange to receive value as DateTime - onChangeDateTime: (DateTime dateTime) { - // print(dateTime); - debugPrint("[debug datetime]: $dateTime"); - }, - ), - ); - }, - child: Image( - image: AssetImage('images/time.png'), - width: 30, - height: 30, - ), - ), - SizedBox(height: 5,), - GestureDetector( - onTap: (){ - Navigator.of(context).push( - showPicker( - showSecondSelector: true, - context: context, - value: _time, - onChange: onTimeChanged, - minuteInterval: TimePickerInterval.FIVE, - // Optional onChange to receive value as DateTime - onChangeDateTime: (DateTime dateTime) { - // print(dateTime); - debugPrint("[debug datetime]: $dateTime"); - }, - ), - ); - }, - child: Image( - image: AssetImage('images/time.png'), - width: 30, - height: 30, - ), - ), - - SizedBox(height: 5,), - GestureDetector( - onTap: (){ - Navigator.of(context).push( - showPicker( - showSecondSelector: true, - context: context, - value: _time, - onChange: onTimeChanged, - minuteInterval: TimePickerInterval.FIVE, - // Optional onChange to receive value as DateTime - onChangeDateTime: (DateTime dateTime) { - // print(dateTime); - debugPrint("[debug datetime]: $dateTime"); - }, - ), - ); - }, - child: Image( - image: AssetImage('images/time.png'), - width: 30, - height: 30, - ), - ), - ], - ), - - - ], - ), - ], - ), - ) - )*/ ); } } diff --git a/lib/prescriptions/oreder_medicines.dart b/lib/prescriptions/oreder_medicines.dart index 7e98174..5ea4ad2 100644 --- a/lib/prescriptions/oreder_medicines.dart +++ b/lib/prescriptions/oreder_medicines.dart @@ -1036,6 +1036,55 @@ class _OrderMedicinesState extends State { crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start, children: [ + Padding( + padding: EdgeInsets.all(10), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + 'Problem: ' + + widget.prescriptionDetails.problem + .toString() + .toUpperCase(), + style: problemTextStyle()), + Text( + widget.prescriptionDetails.doctorName + .toString() + .toUpperCase(), + style: valuesTextStyle()), + Text( + widget.prescriptionDetails.hospitalName + .toString() + .toUpperCase(), + style: valuesTextStyle()), + Text(widget.prescriptionDetails.date.toString().toUpperCase(), + style: valuesTextStyle()), + Text( + widget.prescriptionDetails.patient_name + .toString() + .toUpperCase(), + style: valuesTextStyle()), + Row( + children: [ + Text( + widget.prescriptionDetails.gender + .toString() + .toUpperCase(), + style: valuesTextStyle()), + SizedBox( + width: MediaQuery.of(context).size.width * .05, + ), + Text( + widget.prescriptionDetails.age + .toString() + .toUpperCase() + + " Yrs", + style: valuesTextStyle()), + ], + ) + ], + ), + ), Padding( padding: EdgeInsets.all(10), child: prescriptions(widget.prescriptionDetails), @@ -1260,7 +1309,10 @@ class _OrderMedicinesState extends State { items: AreaItems.map((String items) { return DropdownMenuItem( value: items, - child: Text(items,style: TextStyle(fontSize: 12),), + child: Text( + items, + style: TextStyle(fontSize: 12), + ), ); }).toList(), // After selecting the desired option,it will diff --git a/lib/prescriptions/prescriptions.dart b/lib/prescriptions/prescriptions.dart index 36e1661..d4f687f 100644 --- a/lib/prescriptions/prescriptions.dart +++ b/lib/prescriptions/prescriptions.dart @@ -656,17 +656,11 @@ class _PrescriptionsState extends State { payload["url"] = obj.prescriptionImages[index]['url']; try { - var res = await AppSettings - .deleteRecordsNew( - payload, - obj.recordId); + var res = await AppSettings.deleteRecordsNew(payload, obj.recordId); print(jsonDecode(res)); - Navigator.of(context, - rootNavigator: true) - .pop(); + Navigator.of(context, rootNavigator: true).pop(); Navigator.of(context).pop(true); - AppSettings.longSuccessToast( - "Image deleted Successfully"); + AppSettings.longSuccessToast("Image deleted Successfully"); setState(() { obj.prescriptionImages = jsonDecode( diff --git a/lib/report_my_self.dart b/lib/report_my_self.dart deleted file mode 100644 index 1a1abae..0000000 --- a/lib/report_my_self.dart +++ /dev/null @@ -1,219 +0,0 @@ -import 'dart:convert'; -import 'dart:io'; - -import 'package:flutter/material.dart'; -import 'package:flutter/services.dart'; -import 'package:healthcare_user/common/settings.dart'; -import 'package:image_picker/image_picker.dart'; - -class ReportMySelf extends StatefulWidget { - const ReportMySelf({Key? key}) : super(key: key); - - @override - State createState() => _ReportMySelfState(); -} - -class _ReportMySelfState extends State { - - TextEditingController problemNameController = TextEditingController(); - TextEditingController descriptionController = TextEditingController(); - final ImagePicker _picker = ImagePicker(); - String videoUrl=''; - - Future takeVideoFromCamera() async { - try { - final image = await _picker.pickVideo(source: ImageSource.camera); - if (image == null) return; - final imageTemp = File(image.path); - AppSettings.preLoaderDialog(context); - var res = await AppSettings.uploadVideoInReportMySelf(image); - print(jsonDecode(res)); - Navigator.of(context, rootNavigator: true).pop(); - setState(() { - videoUrl = jsonDecode(res)['picture']; - }); - } on PlatformException catch (e) { - print('Failed to pick video: $e'); - } - } - - Future pickVideoFromGallery() async { - try { - final image = await _picker.pickVideo(source: ImageSource.gallery); - if (image == null) return; - final imageTemp = File(image.path); - - AppSettings.preLoaderDialog(context); - var res = await AppSettings.uploadVideoInReportMySelf(image); - print(jsonDecode(res)); - Navigator.of(context, rootNavigator: true).pop(); - setState(() { - videoUrl = jsonDecode(res)['picture']; - }); - } on PlatformException catch (e) { - print('Failed to pick video: $e'); - } - } - - - @override - Widget build(BuildContext context) { - return Scaffold( - appBar: AppSettings.appBar('Report MySelf'), - body: Container( - child: Padding( - padding: EdgeInsets.all(10), - child:Column( - children: [ - Container( - padding: const EdgeInsets.all(10), - child: TextFormField( - cursorColor: greyColor, - controller: problemNameController, - keyboardType: TextInputType.number, - decoration: const InputDecoration( - prefixIcon: Icon( - Icons.phone, - color: greyColor, - ), - border: OutlineInputBorder( - borderSide: BorderSide(color: primaryColor)), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide(color:primaryColor), - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide(color: primaryColor), - ), - labelText: 'Enter problem name', - labelStyle: TextStyle( - color: greyColor, //<-- SEE HERE - ), - ), - ), - ), - const SizedBox( - height: 15, - ), - Container( - padding: const EdgeInsets.all(10), - child: TextFormField( - cursorColor: greyColor, - controller: descriptionController, - keyboardType: TextInputType.number, - decoration: const InputDecoration( - prefixIcon: Icon( - Icons.description, - color: greyColor, - ), - border: OutlineInputBorder( - borderSide: BorderSide(color: primaryColor)), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide(color:primaryColor), - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide(color: primaryColor), - ), - labelText: 'Description', - labelStyle: TextStyle( - color: greyColor, //<-- SEE HERE - ), - ), - ), - ), - Row( - children: [ - - IconButton( - icon: Icon( - Icons.audio_file, - color: primaryColor, - ), - onPressed: () { - - }, - ), - SizedBox(width: 10,), - IconButton( - icon: Icon( - Icons.video_camera_back_rounded, - color: primaryColor, - ), - onPressed: () { - showModalBottomSheet( - context: context, - builder: (BuildContext context) { - return SizedBox( - height: 200, - child: Center( - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - GestureDetector( - child: Icon( - Icons.camera_alt_outlined, - size: 100, - color: greyColor, - ), - onTap: () async { - await takeVideoFromCamera(); - Navigator.pop(context); - }, - ), - SizedBox( - width: MediaQuery.of(context).size.width * .20, - ), - GestureDetector( - child: Icon( - Icons.photo, - size: 100, - color: greyColor, - ), - onTap: () async { - await pickVideoFromGallery(); - Navigator.pop(context); - }, - ), - ], - ), - ), - ); - }); - }, - ), - SizedBox(width: 10,), - IconButton( - icon: Icon( - Icons.image, - color: primaryColor, - ), - onPressed: () { - - }, - ), - ], - ), - Visibility( - visible: videoUrl != '', - child: Padding( - padding: EdgeInsets.fromLTRB(10,0,0,0), - child: Container( - width: MediaQuery.of(context).size.width * .18, - height: MediaQuery.of(context).size.height * .10, - decoration: BoxDecoration( - shape: BoxShape.rectangle, - image: DecorationImage( - image: NetworkImage(videoUrl) as ImageProvider, // picked file - fit: BoxFit.contain)), - ), - - ), - ), - - - ], - ), - ), - ), - ); - } -} diff --git a/lib/report_problem/all_problems.dart b/lib/report_problem/all_problems.dart new file mode 100644 index 0000000..1813cce --- /dev/null +++ b/lib/report_problem/all_problems.dart @@ -0,0 +1,1079 @@ +import 'dart:convert'; +import 'package:flutter/material.dart'; +import 'package:healthcare_user/common/settings.dart'; +import 'package:healthcare_user/common/zoom_image.dart'; +import 'package:healthcare_user/models/all_problems_model.dart'; +import 'package:healthcare_user/report_problem/report_my_self.dart'; +import 'package:healthcare_user/report_problem/video_file.dart'; +import 'package:photo_view/photo_view.dart'; +import 'package:intl/intl.dart'; +import 'package:flutter_sound/flutter_sound.dart'; +import 'package:assets_audio_player/assets_audio_player.dart'; + +class AllProblemsReportMyself extends StatefulWidget { + const AllProblemsReportMyself({Key? key}) : super(key: key); + + @override + State createState() => _AllProblemsReportMyselfState(); +} + +class _AllProblemsReportMyselfState extends State { + + + List allProblemsList = []; + List allProblemsListOriginal = []; + bool isProblemDataLoading = false; + bool isSereverIssue = false; + TextEditingController searchController = TextEditingController(); + TextEditingController dateInput = TextEditingController(); + TextEditingController fromdateController = TextEditingController(); + TextEditingController todateController = TextEditingController(); + String dropdownSearchType = 'All'; + bool isAudioButtonPressed=false; + bool _playAudio=false; + final recordingPlayer = AssetsAudioPlayer(); + var typeOfSearchItems = [ + 'All', + 'Problem', + 'Date', + ]; + + Future getAllProblemsReportMyself() async { + isProblemDataLoading=true; + try { + var response = await AppSettings.getAllReportProblemDetalis(); + + setState(() { + allProblemsListOriginal = ((jsonDecode(response)) as List) + .map((dynamic model) { + return AllProblemsModel.fromJson(model); + }).toList(); + allProblemsList=allProblemsListOriginal.reversed.toList(); + isProblemDataLoading = false; + }); + } catch (e) { + setState(() { + isProblemDataLoading = false; + isSereverIssue = true; + }); + } + } + + Future getAllProblemsReportMyselfByProblem(var problem) async { + + isProblemDataLoading=true; + try { + var response = await AppSettings.getAllReportProblemDetalis(); + + setState(() { + allProblemsListOriginal = ((jsonDecode(response)) as List) + .map((dynamic model) { + return AllProblemsModel.fromJson(model); + }).toList(); + allProblemsList=allProblemsListOriginal.reversed.toList(); + allProblemsList= allProblemsListOriginal.where( + (x) => x.problem.toString().toLowerCase().contains(problem.toString().toLowerCase()) + ).toList(); + isProblemDataLoading = false; + }); + } catch (e) { + setState(() { + isProblemDataLoading = false; + isSereverIssue = true; + }); + } + } + + + Future getAllProblemsReportMyselfByDateRange(var fromDate,var toDate) async { + isProblemDataLoading = true; + + try { + var response = await AppSettings.getAllReportProblemDetalis(); + + setState(() { + allProblemsListOriginal = ((jsonDecode(response)) as List) + .map((dynamic model) { + return AllProblemsModel.fromJson(model); + }).toList(); + allProblemsList=allProblemsListOriginal.reversed.toList(); + var dateToCheck = DateTime.now().add(Duration(days: -1)); + + allProblemsList = allProblemsListOriginal.where((product) { + final date = product.dateForFilter; + final startDate =DateFormat('dd-MM-yyyy').parse(fromDate); + final endDate = DateFormat('dd-MM-yyyy').parse(toDate); + return date.isAfter(startDate) && date.isBefore(endDate); + //reportsList=reportsListOriginal.reversed.toList(); + }).toList(); + + /*if( dateToCheck.isAfter(startDate) && dateToCheck.isBefore(endDate)) + { + print("dateToCheck is between now and lastYear"); + } + else + { + print("dateToCheck is not between now and lastYear"); + }*/ + + + isProblemDataLoading = false; + }); + } catch (e) { + setState(() { + isProblemDataLoading = false; + isSereverIssue = true; + }); + } + } + + + @override + void initState() { + getAllProblemsReportMyself(); + var now = new DateTime.now(); + String formattedDate = DateFormat('dd-MM-yyyy').format(now); + fromdateController.text=formattedDate; + todateController.text=formattedDate; + super.initState(); + } + + + showPicDialog(var imageUrl){ + return showDialog( + context: context, + barrierDismissible: false, + builder: (BuildContext context) { + return StatefulBuilder( + builder: (BuildContext context, StateSetter setState) { + return AlertDialog( + title: const Text(''), + content: SingleChildScrollView( + child: ListBody( + children: [ + Container( + width: MediaQuery.of(context).size.width * .10, + height: MediaQuery.of(context).size.height * .50, + child: PhotoView( + imageProvider: NetworkImage(imageUrl) as ImageProvider, + maxScale: PhotoViewComputedScale.contained * 4.0, + minScale: PhotoViewComputedScale.contained, + initialScale: PhotoViewComputedScale.contained, + basePosition: Alignment.center, + + ) + ) + ], + ), + ), + actions: [ + TextButton( + child: Text('Close', style: textButtonStyle()), + onPressed: () { + Navigator.of(context).pop(); + }, + ), + ], + ); + }); + }, + ); + } + + + Widget findings(var obj){ + return Container( + width: double.infinity, + height: MediaQuery.of(context).size.height * .20, + child: ListView.builder( + scrollDirection: Axis.horizontal, + itemCount: obj.findingsImages.length, + itemBuilder: (context, index) { + return Column( + children: [ + Card( + child: GestureDetector( + onTap: (){ + /*showPicDialog(obj.findingsImages[index]['url']);*/ + Navigator.push( + context, + new MaterialPageRoute( + builder: (__) => new ImageZoomPage(imageName:'Findings',imageDetails:obj.findingsImages[index]['url']))); + }, + child: Container( + width: MediaQuery.of(context).size.width * + .30, + height: + MediaQuery.of(context).size.height * + .15, + decoration: BoxDecoration( + shape: BoxShape.rectangle, + image: DecorationImage( + image: NetworkImage( + obj.findingsImages[index]['url']) + as ImageProvider, // picked file + fit: BoxFit.fill)), + ), + ), + ), + /*Expanded(child:IconButton( + icon: const Icon(Icons.remove,color: Colors.red,), + + onPressed: () async{ + + }, + ),)*/ + ], + ); + }), + ); + } + + Widget reports(var obj){ + + return Container( + width: double.infinity, + height: MediaQuery.of(context).size.height * .20, + child: ListView.builder( + scrollDirection: Axis.horizontal, + itemCount: obj.reportImages.length, + itemBuilder: (context, index) { + return Column( + children: [ + Card( + child: GestureDetector( + onTap: (){ + //showPicDialog(obj.reportImages[index]['url']); + + Navigator.push( + context, + new MaterialPageRoute( + builder: (__) => new ImageZoomPage(imageName:'Reports',imageDetails:obj.reportImages[index]['url']))); + + }, + child: Container( + width: MediaQuery.of(context).size.width * .30, + height: MediaQuery.of(context).size.height * .15, + decoration: BoxDecoration( + shape: BoxShape.rectangle, + image: DecorationImage( + image: NetworkImage( + obj.reportImages[index] + ['url']) + as ImageProvider, // picked file + fit: BoxFit.fill)), + ), + ), + ), + /*Expanded(child:IconButton( + icon: const Icon(Icons.remove,color: Colors.red,), + + onPressed: () async{ + + }, + ),)*/ + ], + ); + }), + ); + + } + + + + Future playFunc(var audio) async { + recordingPlayer.open( + Audio.file(audio), + autoStart: true, + showNotification: true, + ); + } + + Future stopPlayFunc() async { + recordingPlayer.stop(); + } + + Widget _filtereddata(){ + if(allProblemsList.length!=0){ + return ListView.builder( + itemCount: allProblemsList.length, + itemBuilder: (BuildContext context, int index) { + return GestureDetector( + onTap: (){ + + }, + child: Card( + + //color: prescriptionsList[index].cardColor, + child: Padding( + padding:EdgeInsets.all(8) , + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + + Container( + width: MediaQuery.of(context).size.width * .60, + child: + Column( + children: [ + Row( + children: [ + Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + 'Problem', + style: labelTextStyle(), + ), + SizedBox(height:MediaQuery.of(context).size.height * .01,), + Text( + 'Description', + style: labelTextStyle(), + ), + + SizedBox(height:MediaQuery.of(context).size.height * .01,), + Text( + 'Date', + style: labelTextStyle(), + ), + ], + ), + SizedBox(width:MediaQuery.of(context).size.width * .01,), + Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + ':', + style: labelTextStyle(), + ), + SizedBox(height:MediaQuery.of(context).size.height * .01,), + Text( + ':', + style: labelTextStyle(), + ), + SizedBox(height:MediaQuery.of(context).size.height * .01,), + Text( + ':', + style: labelTextStyle(), + ), + ], + ), + SizedBox(width:MediaQuery.of(context).size.width * .01,), + Expanded(child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + allProblemsList[index] + .problem + .toString() + .toUpperCase(), + style: valuesTextStyle()), + SizedBox(height:MediaQuery.of(context).size.height * .01,), + Text( + allProblemsList[index].description + .toString() + .toUpperCase(), + style: valuesTextStyle()), + SizedBox(height:MediaQuery.of(context).size.height * .01,), + Text( + allProblemsList[index] + .date + .toString() + .toUpperCase(), + style: valuesTextStyle()), + ], + ),) + ], + ), + Row( + children: [ + Visibility( + visible: allProblemsList[index].audio!='', + child: ElevatedButton( + style: ElevatedButton.styleFrom( + primary: primaryColor, // background + onPrimary: Colors.white, // foreground + ), + onPressed: () async { + setState(() { + + + if(!allProblemsList[index].isAudioButtonEnabled){ + setState(() { + allProblemsList[index].isAudioButtonEnabled=true; + }); + } + else{ + setState(() { + allProblemsList[index].isAudioButtonEnabled=false; + }); + } + }); + }, + child: const Text('Audio'), + ),), + Visibility( + visible: allProblemsList[index].audio!='', + child: SizedBox( + width:MediaQuery.of(context).size.width * .01, + ) ,), + Visibility( + visible: allProblemsList[index].video!='', + child: ElevatedButton( + style: ElevatedButton.styleFrom( + primary: primaryColor, // background + onPrimary: Colors.white, // foreground + ), + onPressed: () async { + Navigator.push( + context, + new MaterialPageRoute( + builder: (__) => new ProblemVideo(videoUrl:allProblemsList[index].video))); + + }, + child: const Text('Video'), + ),), + + Visibility( + visible: allProblemsList[index].video!='', + child: SizedBox( + width:MediaQuery.of(context).size.width * .01, + ) ,), + Visibility( + visible: allProblemsList[index].image!='', + child: ElevatedButton( + style: ElevatedButton.styleFrom( + primary: primaryColor, // background + onPrimary: Colors.white, // foreground + ), + onPressed: () async { + Navigator.push( + context, + new MaterialPageRoute( + builder: (__) => new ImageZoomPage(imageName:'Problem Picture',imageDetails:allProblemsList[index].image))); + + }, + child: const Text('Image'), + ),), + + ], + ), + Visibility( + visible: allProblemsList[index].isAudioButtonEnabled, + child:Row( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + ElevatedButton.icon( + style: + ElevatedButton.styleFrom(elevation: 9.0, primary: Colors.red), + onPressed: () { + setState(() { + _playAudio = !_playAudio; + }); + if (_playAudio) playFunc(allProblemsList[index].audio); + if (!_playAudio) stopPlayFunc(); + }, + icon: _playAudio + ? Icon( + Icons.stop, + ) + : Icon(Icons.play_arrow), + label: _playAudio + ? Text( + "Stop", + style: TextStyle( + fontSize: 28, + ), + ) + : Text( + "Play", + style: TextStyle( + fontSize: 28, + ), + ), + ), + ], + ) + ) + + ], + ) + ), + + + Visibility( + visible:false, + child: Expanded(child:IconButton( + icon: const Icon(Icons.edit,color: primaryColor,), + onPressed: () { + + /*Navigator.push( + context, + new MaterialPageRoute( + builder: (__) => new UpdateReport(reportDetails:allProblemsList[index]))).then((value) { + getAllProblemsReportMyself(); + });*/ + }, + ),), + ), + Expanded(child:IconButton( + icon: const Icon(Icons.delete,color: primaryColor,), + + onPressed: () async{ + showDialog( + //if set to true allow to close popup by tapping out of the popup + //barrierDismissible: false, + context: context, + builder: (BuildContext context) => AlertDialog( + title: const Text('Do you want to delete Record?', + style: TextStyle( + color: primaryColor, + fontSize: 20, + )), + actionsAlignment: MainAxisAlignment.spaceBetween, + actions: [ + TextButton( + onPressed: ()async { + + bool deleteTankStatus = await AppSettings.deleteReportMySelfProblem(allProblemsList[index].problemId); + + + if(deleteTankStatus){ + getAllProblemsReportMyself(); + AppSettings.longSuccessToast('Problem deleted successfully'); + Navigator.of(context).pop(true); + + } + else{ + AppSettings.longFailedToast('Problem deletion failed'); + Navigator.of(context).pop(true); + } + }, + child: const Text('Yes', + style: TextStyle( + color: primaryColor, + fontSize: 20, + )), + ), + TextButton( + onPressed: () { + Navigator.of(context).pop(true); + }, + child: const Text('No', + style: TextStyle( + color: primaryColor, + fontSize: 20, + )), + ), + ], + ), + ); + + + + }, + ),) + + ], + + ), + + ], + ), + ), + ), + ); + }); + } + else{ + return Padding(padding: EdgeInsets.fromLTRB(60,10,60,10), + child: Column( + children: [ + Text('No problems found related to your search'), + SizedBox( + height: 20, + ), + CircleAvatar( + backgroundColor: Colors.red, + radius: 30, + child: const Icon( + Icons.info, + color: Colors.white, + ), + ) + ], + ),); + + } + } + + + Widget _allreports(){ + + if(allProblemsListOriginal.length!=0){ + + return Padding(padding:EdgeInsets.all(10), + child:Column( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Container( + child: DropdownButtonFormField( + // Initial Value + value: dropdownSearchType, + isExpanded: true, + decoration: const InputDecoration( + prefixIcon: Icon( + Icons.search, + color: greyColor, + ), + border: OutlineInputBorder( + borderSide: BorderSide(color: greyColor)), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide(color: greyColor), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide(color: greyColor), + ), + labelText: 'Search By', + labelStyle: TextStyle( + color: greyColor, //<-- SEE HERE + ), + ), + + hint: Text('Select Search Type'), + // Down Arrow Icon + icon: const Icon(Icons.keyboard_arrow_down), + + // Array list of items + items: typeOfSearchItems.map((String items) { + return DropdownMenuItem( + value: items, + child: Text(items), + ); + }).toList(), + // After selecting the desired option,it will + // change button value to selected value + onChanged: (String? newValue) { + setState(() { + dropdownSearchType = newValue!; + }); + }, + ), + ), + SizedBox(height: MediaQuery.of(context).size.height * .01,), + Visibility( + visible:dropdownSearchType.toString().toLowerCase()=='problem' , + child: Container( + height: MediaQuery.of(context).size.height * .07, + child: Center(child: TextField( + + cursorColor: primaryColor, + controller: searchController, + onChanged: (string) { + if(string.length>=1){ + getAllProblemsReportMyselfByProblem(string); + } + else{ + getAllProblemsReportMyself(); + } + }, + decoration: InputDecoration( + prefixIcon: Icon( + Icons.search, + color: primaryColor, + ), + /*suffixIcon: Icon( + Icons.clear, + color: greyColor, + ),*/ + suffixIcon: searchController.text!=''?IconButton( + icon: Icon( + Icons.clear, + color: Colors.red, + ), + onPressed: () { + setState(() { + searchController.text=''; + }); + getAllProblemsReportMyself(); + }, + ):IconButton( + icon: Icon( + Icons.clear, + color: Colors.transparent, + ), + onPressed: () { + }, + ), + border: OutlineInputBorder( + borderSide: BorderSide(color: primaryColor), + borderRadius: BorderRadius.circular(30), + ), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide(color: primaryColor), + borderRadius: BorderRadius.circular(30), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide(color: primaryColor), + borderRadius: BorderRadius.circular(30), + ), + //labelText: 'Search by phone number', + hintText: 'Search by problem', + labelStyle: TextStyle( + color: greyColor, //<-- SEE HERE + ), + ), + ),) + ),), + Visibility( + visible:dropdownSearchType.toString().toLowerCase()=='doctor' , + child: Container( + height: MediaQuery.of(context).size.height * .07, + child: Center(child: TextField( + + cursorColor: primaryColor, + controller: searchController, + onChanged: (string) { + if(string.length>=1){ + //getRecordsByDoctorName(string); + } + else{ + getAllProblemsReportMyself(); + } + }, + decoration: InputDecoration( + prefixIcon: Icon( + Icons.search, + color: primaryColor, + ), + /*suffixIcon: Icon( + Icons.clear, + color: greyColor, + ),*/ + suffixIcon: searchController.text!=''?IconButton( + icon: Icon( + Icons.clear, + color: Colors.red, + ), + onPressed: () { + setState(() { + searchController.text=''; + }); + getAllProblemsReportMyself(); + }, + ):IconButton( + icon: Icon( + Icons.clear, + color: Colors.transparent, + ), + onPressed: () { + }, + ), + border: OutlineInputBorder( + borderSide: BorderSide(color: primaryColor), + borderRadius: BorderRadius.circular(30), + ), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide(color: primaryColor), + borderRadius: BorderRadius.circular(30), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide(color: primaryColor), + borderRadius: BorderRadius.circular(30), + ), + //labelText: 'Search by phone number', + hintText: 'Search by doctor', + labelStyle: TextStyle( + color: greyColor, //<-- SEE HERE + ), + ), + ),) + ),), + Visibility( + visible:dropdownSearchType.toString().toLowerCase()=='date', + child: Container( + //height: 60, + child: Row( + children: [ + Expanded( + child: TextField( + + cursorColor: primaryColor, + controller: fromdateController, + onChanged: (string) { + if(string.length>=1){ + //getRecordsByDate(string); + } + else{ + getAllProblemsReportMyself(); + } + }, + onTap: () async { + DateTime? pickedDate = await showDatePicker( + context: context, + initialDate: DateTime.now(), + firstDate: DateTime(1950), + lastDate: DateTime.now(), + builder: (BuildContext context, Widget? child) { + return Theme( + data: ThemeData.dark().copyWith( + colorScheme: ColorScheme.dark( + primary: buttonColors, + onPrimary: Colors.white, + surface: buttonColors, + onSurface: Colors.white, + ), + dialogBackgroundColor: primaryColor, + ), + child: child!, + ); + }, + ); + + if (pickedDate != null) { + print( + pickedDate); //pickedDate output format => 2021-03-10 00:00:00.000 + String formattedDate = + DateFormat('dd-MM-yyyy').format(pickedDate); + print( + formattedDate); //formatted date output using intl package => 2021-03-16 + setState(() { + fromdateController.text = formattedDate; //set output date to TextField value. + }); + getAllProblemsReportMyselfByDateRange(fromdateController.text,todateController.text); + } else {} + }, + decoration: InputDecoration( + prefixIcon: Icon( + Icons.calendar_month, + color: primaryColor, + ), + suffixIcon: fromdateController.text!=''?IconButton( + icon: Icon( + Icons.clear, + color: Colors.red, + ), + onPressed: () { + setState(() { + fromdateController.text=''; + }); + getAllProblemsReportMyself(); + }, + ):IconButton( + icon: Icon( + Icons.clear, + color: Colors.transparent, + ), + onPressed: () { + }, + ), + border: OutlineInputBorder( + borderSide: BorderSide(color: primaryColor), + borderRadius: BorderRadius.circular(30), + ), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide(color: primaryColor), + borderRadius: BorderRadius.circular(30), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide(color: primaryColor), + borderRadius: BorderRadius.circular(30), + ), + //labelText: 'Search by phone number', + hintText: 'From date', + + labelStyle: TextStyle( + color: greyColor, //<-- SEE HERE + ), + ), + ), + ), + SizedBox(width: 5), + Expanded( + child: TextField( + + cursorColor: primaryColor, + controller: todateController, + onChanged: (string) { + if(string.length>=1){ + //getRecordsByDate(string); + } + else{ + getAllProblemsReportMyself(); + } + }, + onTap: () async { + DateTime? pickedDate = await showDatePicker( + context: context, + initialDate: DateTime.now(), + firstDate: DateTime(1950), + lastDate: DateTime.now(), + builder: (BuildContext context, Widget? child) { + return Theme( + data: ThemeData.dark().copyWith( + colorScheme: ColorScheme.dark( + primary: buttonColors, + onPrimary: Colors.white, + surface: buttonColors, + onSurface: Colors.white, + ), + dialogBackgroundColor: primaryColor, + ), + child: child!, + ); + }, + ); + + if (pickedDate != null) { + print( + pickedDate); //pickedDate output format => 2021-03-10 00:00:00.000 + String formattedDate = + DateFormat('dd-MM-yyyy').format(pickedDate); + print( + formattedDate); //formatted date output using intl package => 2021-03-16 + setState(() { + todateController.text = formattedDate; //set output date to TextField value. + }); + getAllProblemsReportMyselfByDateRange(fromdateController.text,todateController.text); + } else {} + }, + decoration: InputDecoration( + prefixIcon: Icon( + Icons.calendar_month, + color: primaryColor, + ), + suffixIcon: todateController.text!=''?IconButton( + icon: Icon( + Icons.clear, + color: Colors.red, + ), + onPressed: () { + setState(() { + todateController.text=''; + }); + getAllProblemsReportMyself(); + }, + ):IconButton( + icon: Icon( + Icons.clear, + color: Colors.transparent, + ), + onPressed: () { + }, + ), + border: OutlineInputBorder( + borderSide: BorderSide(color: primaryColor), + borderRadius: BorderRadius.circular(30), + ), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide(color: primaryColor), + borderRadius: BorderRadius.circular(30), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide(color: primaryColor), + borderRadius: BorderRadius.circular(30), + ), + //labelText: 'Search by phone number', + hintText: 'To date', + + labelStyle: TextStyle( + color: greyColor, //<-- SEE HERE + ), + ), + ), + ), + SizedBox(width: 5), + + ], + ), + ),), + Expanded(child: _filtereddata()), + Padding( + padding: EdgeInsets.fromLTRB(8, 8, 8, 8), + child: CircleAvatar( + backgroundColor: primaryColor, + radius: 40, + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + IconButton( + iconSize: 40, + icon: const Icon( + Icons.add, + color: Colors.white, + ), + onPressed: () async{ + Navigator.push(context, MaterialPageRoute(builder: (context) => ReportMySelf())).then((value) { + getAllProblemsReportMyself(); + }); + }, + ), + ], + ), + ), + ), + ])); + + + } + else{ + return Center( + child: Padding( + padding: EdgeInsets.fromLTRB(0, 40, 0, 0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + SizedBox(height: MediaQuery.of(context).size.height * .25,), + Text('Click below icon to add new problem'), + SizedBox( + height: 20, + ), + CircleAvatar( + backgroundColor: primaryColor, + radius: 40, + child: IconButton( + iconSize: 40, + icon: const Icon( + Icons.add, + color: Colors.white, + ), + onPressed: () async { + Navigator.push(context, MaterialPageRoute(builder: (context) => ReportMySelf())).then((value) { + getAllProblemsReportMyself(); + }); + }, + ), + ) + ], + ), + ) + ); + } + + + } + + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppSettings.appBar('Report My Self'), + body: isProblemDataLoading?Center( + child: CircularProgressIndicator( + color: primaryColor, + strokeWidth: 5.0, + ), + ): _allreports(), + ); + } +} + diff --git a/lib/report_problem/audio_file.dart b/lib/report_problem/audio_file.dart new file mode 100644 index 0000000..16b327d --- /dev/null +++ b/lib/report_problem/audio_file.dart @@ -0,0 +1,59 @@ +import 'package:flutter/material.dart'; +import 'package:video_player/video_player.dart'; +import 'package:flick_video_player/flick_video_player.dart'; + +class ProblemAudio extends StatefulWidget { + var videoUrl; + ProblemAudio({this.videoUrl}); + + @override + State createState() => _ProblemAudioState(); +} + +class _ProblemAudioState extends State { + + late VideoPlayerController _controller; + late Future _initializeVideoPlayerFuture; + late FlickManager flickManager; + + @override + void initState() { + super.initState(); + _controller = VideoPlayerController.networkUrl( + Uri.parse(widget.videoUrl,), + ); + flickManager = FlickManager( + videoPlayerController: + VideoPlayerController.networkUrl(Uri.parse(widget.videoUrl,),) + ); + _initializeVideoPlayerFuture = _controller.initialize(); + _controller.setLooping(false); + } + @override + void dispose() { + // Ensure disposing of the VideoPlayerController to free up resources. + _controller.dispose(); + flickManager.dispose(); + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return Container( + height: MediaQuery.of(context).size.height * .30, + width: double.infinity, + child:FlickVideoPlayer( + flickManager: flickManager, + flickVideoWithControls: FlickVideoWithControls( + videoFit: BoxFit.fill, + controls: FlickPortraitControls( + progressBarSettings: + FlickProgressBarSettings(playedColor: Colors.green), + ), + ), + + ), + + ); + } +} diff --git a/lib/report_problem/report_my_self.dart b/lib/report_problem/report_my_self.dart new file mode 100644 index 0000000..645174a --- /dev/null +++ b/lib/report_problem/report_my_self.dart @@ -0,0 +1,783 @@ +import 'dart:convert'; +import 'dart:io'; +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:healthcare_user/common/settings.dart'; +import 'package:image_picker/image_picker.dart'; +import 'package:video_player/video_player.dart'; +import 'package:flick_video_player/flick_video_player.dart'; +import 'package:flutter_sound/flutter_sound.dart'; +import 'package:assets_audio_player/assets_audio_player.dart'; +import 'package:permission_handler/permission_handler.dart'; +import 'package:intl/date_symbol_data_local.dart'; +import 'dart:async'; +import 'package:flutter/cupertino.dart'; +import 'package:path/path.dart' as path; +import 'package:intl/intl.dart' show DateFormat; +import 'package:path_provider/path_provider.dart'; + +class ReportMySelf extends StatefulWidget { + const ReportMySelf({Key? key}) : super(key: key); + + @override + State createState() => _ReportMySelfState(); +} + +class _ReportMySelfState extends State { + + TextEditingController problemNameController = TextEditingController(); + TextEditingController descriptionController = TextEditingController(); + TextEditingController dateInput = TextEditingController(); + final ImagePicker _picker = ImagePicker(); + String videoUrl=''; + late VideoPlayerController _controller; + late Future _initializeVideoPlayerFuture; + late FlickManager flickManager; + late FlutterSoundRecorder _recordingSession; + final recordingPlayer = AssetsAudioPlayer(); + String pathToAudio=''; + bool _playAudio = false; + String _timerText = '00:00:00'; + bool isAudioButtonPressed=false; + String recordingTime = '0:0'; // to store value + bool isRecording = false; + String problemPictureUrl=''; + + void initializer() async { + pathToAudio = '/sdcard/Download/temp.wav'; + _recordingSession = FlutterSoundRecorder(); + await _recordingSession.openAudioSession( + focus: AudioFocus.requestFocusAndStopOthers, + category: SessionCategory.playAndRecord, + mode: SessionMode.modeDefault, + device: AudioDevice.speaker); + await _recordingSession.setSubscriptionDuration(Duration(milliseconds: 10)); + await initializeDateFormatting(); + await Permission.microphone.request(); + await Permission.storage.request(); + await Permission.manageExternalStorage.request(); + } + + @override + void initState() { + super.initState(); + _controller = VideoPlayerController.networkUrl( + Uri.parse(videoUrl,), + ); + flickManager = FlickManager( + videoPlayerController: + VideoPlayerController.networkUrl(Uri.parse(videoUrl,),) + ); + _initializeVideoPlayerFuture = _controller.initialize(); + _controller.setLooping(false); + + /*initializer();*/ + } + + @override + void dispose() { + // Ensure disposing of the VideoPlayerController to free up resources. + _controller.dispose(); + flickManager.dispose(); + _recordingSession.dispositionStream(); + pathToAudio=''; + super.dispose(); + recordingPlayer.stop(); + _deleteCacheDir(); + _deleteAppDir(); + } + + Future _deleteCacheDir() async { + Directory tempDir = await getTemporaryDirectory(); + + if (tempDir.existsSync()) { + tempDir.deleteSync(recursive: true); + } + } + + Future _deleteAppDir() async { + Directory appDocDir = await getApplicationDocumentsDirectory(); + + if (appDocDir.existsSync()) { + appDocDir.deleteSync(recursive: true); + } + } + + Future startRecording() async { + initializer(); + + setState(() { + isRecording=true; + }); + Directory directory = Directory(path.dirname(pathToAudio)); + if (!directory.existsSync()) { + directory.createSync(); + } + _recordingSession=(await FlutterSoundRecorder().openAudioSession())!; + + await _recordingSession.startRecorder( + toFile: pathToAudio, + codec: Codec.pcm16WAV, + ); + recordTime(); + StreamSubscription _recorderSubscription = _recordingSession.onProgress!.listen((e) { + + /*var date = DateTime.fromMillisecondsSinceEpoch(e.duration.inMilliseconds, + isUtc: true); + var timeText = DateFormat('mm:ss:SS', 'en_GB').format(date); + setState(() { + _timerText = timeText.substring(0, 8); + });*/ + }); + _recorderSubscription.cancel(); + } + + + + void recordTime() { + + var startTime = DateTime.now(); + Timer.periodic(const Duration(seconds: 1), (Timer t) { + var diff = DateTime.now().difference(startTime); + + + + if (!isRecording) { + t.cancel(); //cancel function calling + } + + setState(() { + recordingTime = + '${diff.inHours < 60 ? diff.inHours : 0}:${diff.inMinutes < 60 ? diff.inMinutes : 0}:${diff.inSeconds < 60 ? diff.inSeconds : 0}'; + + print(recordingTime); + }); + }); + } + + Future stopRecording() async { + + setState(() { + isRecording=false; + }); + _recordingSession.closeAudioSession(); + return await _recordingSession.stopRecorder(); + } + + Future playFunc() async { + recordingPlayer.open( + Audio.file(pathToAudio), + autoStart: true, + showNotification: true, + ); + } + + Future stopPlayFunc() async { + recordingPlayer.stop(); + } + + Future takeVideoFromCamera() async { + try { + final image = await _picker.pickVideo(source: ImageSource.camera); + if (image == null) return; + final imageTemp = File(image.path); + AppSettings.preLoaderDialog(context); + var res = await AppSettings.uploadVideoInReportMySelf(image); + print(jsonDecode(res)); + Navigator.of(context, rootNavigator: true).pop(); + setState(() { + videoUrl = jsonDecode(res)['picture']; + _controller = VideoPlayerController.networkUrl(Uri.parse(videoUrl,),); + flickManager = FlickManager( + videoPlayerController: + VideoPlayerController.networkUrl(Uri.parse(videoUrl,),) + ); + }); + + _initializeVideoPlayerFuture = _controller.initialize(); + _controller.setLooping(true); + } on PlatformException catch (e) { + print('Failed to pick video: $e'); + } + } + + Future pickVideoFromGallery() async { + try { + final image = await _picker.pickVideo(source: ImageSource.gallery); + if (image == null) return; + final imageTemp = File(image.path); + + AppSettings.preLoaderDialog(context); + var res = await AppSettings.uploadVideoInReportMySelf(image); + print(jsonDecode(res)); + Navigator.of(context, rootNavigator: true).pop(); + setState(() { + videoUrl = jsonDecode(res)['picture']; + _controller = VideoPlayerController.networkUrl(Uri.parse(videoUrl,),); + }); + + _initializeVideoPlayerFuture = _controller.initialize(); + _controller.setLooping(true); + } on PlatformException catch (e) { + print('Failed to pick video: $e'); + } + } + + + Future pickImageFromGallery() async { + try { + final image = await _picker.pickImage(source: ImageSource.gallery); + if (image == null) return; + final imageTemp = File(image.path); + AppSettings.preLoaderDialog(context); + var res = await AppSettings.uploadReportMyselfPicture(image); + print(jsonDecode(res)); + Navigator.of(context, rootNavigator: true).pop(); + setState(() { + problemPictureUrl = jsonDecode(res)['pictures'][0]; + }); + } on PlatformException catch (e) { + print('Failed to pick image: $e'); + } + } + + Future takeImageFromCamera() async { + try { + final image = await _picker.pickImage(source: ImageSource.camera); + if (image == null) return; + final imageTemp = File(image.path); + AppSettings.preLoaderDialog(context); + var res = await AppSettings.uploadReportMyselfPicture(image); + print(jsonDecode(res)); + Navigator.of(context, rootNavigator: true).pop(); + setState(() { + problemPictureUrl = jsonDecode(res)['pictures'][0]; + }); + } on PlatformException catch (e) { + print('Failed to pick image: $e'); + } + } + + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppSettings.appBar('Report MySelf'), + body: SingleChildScrollView( + child: Container( + child: Padding( + padding: EdgeInsets.all(10), + child:Column( + children: [ + Container( + child: TextFormField( + cursorColor: greyColor, + controller: problemNameController, + textCapitalization: TextCapitalization.words, + decoration: const InputDecoration( + prefixIcon: Icon( + Icons.report_problem, + color: greyColor, + ), + border: OutlineInputBorder( + borderSide: BorderSide(color: primaryColor)), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide(color:primaryColor), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide(color: primaryColor), + ), + labelText: 'Enter problem name', + labelStyle: TextStyle( + color: greyColor, //<-- SEE HERE + ), + ), + ), + ), + const SizedBox( + height: 10, + ), + Container( + child: TextFormField( + cursorColor: greyColor, + controller: descriptionController, + textCapitalization: TextCapitalization.words, + decoration: const InputDecoration( + prefixIcon: Icon( + Icons.description, + color: greyColor, + ), + border: OutlineInputBorder( + borderSide: BorderSide(color: primaryColor)), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide(color:primaryColor), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide(color: primaryColor), + ), + labelText: 'Description', + labelStyle: TextStyle( + color: greyColor, //<-- SEE HERE + ), + ), + ), + ), + SizedBox(height: 10), + Container( + child: TextFormField( + cursorColor: greyColor, + controller: dateInput, + decoration: textFormFieldDecorationBMI( + Icons.calendar_today, 'Enter Date'), + readOnly: true, + onTap: () async { + DateTime? pickedDate = await showDatePicker( + context: context, + initialDate: DateTime.now(), + firstDate: DateTime(1950), + lastDate: DateTime.now(), + builder: (BuildContext context, Widget? child) { + return Theme( + data: ThemeData.dark().copyWith( + colorScheme: ColorScheme.dark( + primary: buttonColors, + onPrimary: Colors.white, + surface: buttonColors, + onSurface: Colors.white, + ), + dialogBackgroundColor: primaryColor, + ), + child: child!, + ); + }, + ); + + if (pickedDate != null) { + print( + pickedDate); //pickedDate output format => 2021-03-10 00:00:00.000 + String formattedDate = + DateFormat('dd-MM-yyyy').format(pickedDate); + print( + formattedDate); //formatted date output using intl package => 2021-03-16 + setState(() { + dateInput.text = + formattedDate; //set output date to TextField value. + }); + } else {} + }, + ), + ), + SizedBox(height: 10), + Row( + children: [ + + IconButton( + icon: Icon( + Icons.audio_file, + color: primaryColor, + size: 40, + ), + onPressed: () { + + if(!isAudioButtonPressed){ + setState(() { + isAudioButtonPressed=true; + }); + } + else{ + setState(() { + isAudioButtonPressed=false; + pathToAudio=''; + recordingTime = '0:0'; + }); + } + + + }, + ), + SizedBox(width: 10,), + IconButton( + icon: Icon( + Icons.video_camera_back_rounded, + color: primaryColor, + size: 40, + ), + onPressed: () { + showModalBottomSheet( + context: context, + builder: (BuildContext context) { + return SizedBox( + height: 200, + child: Center( + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + GestureDetector( + child: Icon( + Icons.camera_alt_outlined, + size: 100, + color: primaryColor, + ), + onTap: () async { + await takeVideoFromCamera(); + Navigator.pop(context); + }, + ), + SizedBox( + width: MediaQuery.of(context).size.width * .20, + ), + GestureDetector( + child: Icon( + Icons.photo, + size: 100, + color: primaryColor, + ), + onTap: () async { + await pickVideoFromGallery(); + Navigator.pop(context); + }, + ), + ], + ), + ), + ); + }); + }, + ), + SizedBox(width: 10,), + IconButton( + icon: Icon( + Icons.image, + color: primaryColor, + size: 40, + ), + onPressed: () async { + showModalBottomSheet( + context: context, + builder: (BuildContext context) { + return SizedBox( + height: 200, + child: Center( + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + GestureDetector( + child: Icon( + Icons.camera_alt_outlined, + size: 100, + color: primaryColor, + ), + onTap: () async { + await takeImageFromCamera(); + Navigator.pop(context); + }, + ), + SizedBox( + width: + MediaQuery.of(context).size.width * + .20, + ), + GestureDetector( + child: Icon( + Icons.photo, + size: 100, + color: primaryColor, + ), + onTap: () async { + await pickImageFromGallery(); + Navigator.pop(context); + }, + ), + ], + ), + ), + ); + }); + }, + + ), + /*SizedBox(width: 10,), + IconButton( + icon: Icon( + Icons.description, + color: primaryColor, + size: 40, + ), + onPressed: () { + + }, + ),*/ + ], + ), + Visibility( + visible: isAudioButtonPressed, + child: Column( + children: [ + Container( + child: Center( + child: Text( + recordingTime, + style: TextStyle(fontSize: 70, color: Colors.red), + ), + ), + ), + SizedBox( + height: 20, + ), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + + IconButton( + icon: Icon( + Icons.mic, + color: !isRecording?Colors.red:greyColor, + ), + onPressed: () { + + if(!isRecording){ + startRecording(); + } + else{ + AppSettings.longSuccessToast('please stop recording'); + } + + }, + ), + SizedBox( + width: 30, + ), + IconButton( + icon: Icon( + Icons.stop, + color: isRecording?Colors.red:greyColor, + ), + onPressed: () { + if(isRecording){ + stopRecording(); + } + else{ + AppSettings.longSuccessToast('please start recording'); + } + + }, + ), + ], + ), + SizedBox( + height: 20, + ), + + Visibility( + visible: pathToAudio!=''&&!isRecording, + child:Row( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + ElevatedButton.icon( + style: + ElevatedButton.styleFrom(elevation: 9.0, primary: Colors.red), + onPressed: () { + setState(() { + _playAudio = !_playAudio; + }); + if (_playAudio) playFunc(); + if (!_playAudio) stopPlayFunc(); + }, + icon: _playAudio + ? Icon( + Icons.stop, + ) + : Icon(Icons.play_arrow), + label: _playAudio + ? Text( + "Stop", + style: TextStyle( + fontSize: 28, + ), + ) + : Text( + "Play", + style: TextStyle( + fontSize: 28, + ), + ), + ), + IconButton( + icon: Icon( + Icons.delete, + color: Colors.red, + size: 30, + ), + onPressed: () { + + setState(() { + pathToAudio=''; + recordingTime = '0:0'; + }); + }, + ), + ], + ) + ) + + + ], + )), + Visibility( + visible: videoUrl != '', + child: Padding( + padding: EdgeInsets.all(10), + child: Container( + height: MediaQuery.of(context).size.height * .30, + width: double.infinity, + child:FlickVideoPlayer( + flickManager: flickManager, + flickVideoWithControls: FlickVideoWithControls( + videoFit: BoxFit.fill, + controls: FlickPortraitControls( + progressBarSettings: + FlickProgressBarSettings(playedColor: Colors.green), + ), + ), + + ), + + + + /*FutureBuilder( + future: _initializeVideoPlayerFuture, + builder: (context, snapshot) { + if (snapshot.connectionState == ConnectionState.done) { + return AspectRatio( + aspectRatio: _controller.value.aspectRatio, + child: VideoPlayer(_controller), + ); + } else { + return const Center( + child: CircularProgressIndicator(), + ); + } + }, + ),*/ + ), + + + + ), + ), + Visibility( + visible: problemPictureUrl!='', + child: Container( + width: double.infinity, + height: + MediaQuery.of(context).size.height * + .30, + decoration: BoxDecoration( + shape: BoxShape.rectangle, + image: DecorationImage( + image: NetworkImage(problemPictureUrl) as ImageProvider, // picked file + fit: BoxFit.fill)), + child: Stack(children: [ + Positioned( + right: 0, + child: Container( + child: IconButton( + iconSize: 30, + icon: const Icon( + Icons.cancel, + color: Colors.red, + ), + onPressed: () async { + + setState(() { + problemPictureUrl=''; + }); + }, + ), + ), + ) + ]), + ),), + + SizedBox(height: 10), + Container( + width: double.infinity, + height: + MediaQuery.of(context).size.height * .05, + child: ElevatedButton( + style: ElevatedButton.styleFrom( + primary: buttonColors, // background + onPrimary: Colors.black, // foreground + ), + onPressed: () async { + + if(problemNameController.text!=''&&(pathToAudio!=''||problemPictureUrl!=''||videoUrl!='')&&dateInput.text!=''){ + + AppSettings.preLoaderDialog(context); + bool isOnline = + await AppSettings.internetConnectivity(); + + if (isOnline) { + var payload = new Map(); + + List picture=[]; + picture.add({'url':problemPictureUrl}); + + + payload["name"] = problemNameController.text.toString(); + payload["description"] = descriptionController.text.toString(); + payload["date"] = dateInput.text.toString(); + payload["audio"] =pathToAudio.toString(); + payload["video"] = videoUrl.toString(); + payload["picture"] = picture; + + bool uploadStatus = await AppSettings.addReportMySelfProblem(payload); + + try { + if (uploadStatus) { + Navigator.of(context, rootNavigator: true) + .pop(); + AppSettings.longSuccessToast( + 'Report problem added successfully'); + Navigator.pop(context); + } else { + Navigator.of(context, rootNavigator: true) + .pop(); + AppSettings.longFailedToast( + 'Fail to add report problem details'); + } + } catch (e) { + print(e); + Navigator.of(context, rootNavigator: true) + .pop(); + AppSettings.longFailedToast( + 'Fail to add report problem details'); + } + + } + + else{ + AppSettings.longFailedToast('please check internet connection'); + } + } + else{ + AppSettings.longFailedToast('please enter valid details'); + } + + + + + }, + child: const Text('Report a problem'), + )), + + + ], + ), + ), + ), + ) + ); + } +} diff --git a/lib/report_problem/video_file.dart b/lib/report_problem/video_file.dart new file mode 100644 index 0000000..88d7269 --- /dev/null +++ b/lib/report_problem/video_file.dart @@ -0,0 +1,59 @@ +import 'package:flutter/material.dart'; +import 'package:video_player/video_player.dart'; +import 'package:flick_video_player/flick_video_player.dart'; + +class ProblemVideo extends StatefulWidget { + var videoUrl; + ProblemVideo({this.videoUrl}); + + @override + State createState() => _ProblemVideoState(); +} + +class _ProblemVideoState extends State { + + late VideoPlayerController _controller; + late Future _initializeVideoPlayerFuture; + late FlickManager flickManager; + + @override + void initState() { + super.initState(); + _controller = VideoPlayerController.networkUrl( + Uri.parse(widget.videoUrl,), + ); + flickManager = FlickManager( + videoPlayerController: + VideoPlayerController.networkUrl(Uri.parse(widget.videoUrl,),) + ); + _initializeVideoPlayerFuture = _controller.initialize(); + _controller.setLooping(false); + } + @override + void dispose() { + // Ensure disposing of the VideoPlayerController to free up resources. + _controller.dispose(); + flickManager.dispose(); + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return Container( + height: MediaQuery.of(context).size.height * .30, + width: double.infinity, + child:FlickVideoPlayer( + flickManager: flickManager, + flickVideoWithControls: FlickVideoWithControls( + videoFit: BoxFit.fill, + controls: FlickPortraitControls( + progressBarSettings: + FlickProgressBarSettings(playedColor: Colors.green), + ), + ), + + ), + + ); + } +} diff --git a/lib/report_problem/video_recorder.dart b/lib/report_problem/video_recorder.dart new file mode 100644 index 0000000..cc9286c --- /dev/null +++ b/lib/report_problem/video_recorder.dart @@ -0,0 +1,89 @@ +import 'dart:convert'; +import 'dart:io'; +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:healthcare_user/common/settings.dart'; +import 'package:image_picker/image_picker.dart'; +import 'package:visibility_detector/visibility_detector.dart'; + +class VideoRecorderPage extends StatefulWidget { + const VideoRecorderPage({Key? key}) : super(key: key); + + @override + State createState() => _VideoRecorderPageState(); +} + +class _VideoRecorderPageState extends State { + + final ImagePicker _picker = ImagePicker(); + + + Future takeVideoFromCamera() async { + try { + final image = await _picker.pickVideo(source: ImageSource.camera); + if (image == null) return; + final imageTemp = File(image.path); + } on PlatformException catch (e) { + print('Failed to pick video: $e'); + } + } + + + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppSettings.appBar('Video recorder'), + body: Container( + child: IconButton( + icon: Icon( + Icons.video_camera_back_rounded, + color: primaryColor, + size: 40, + ), + onPressed: () { + showModalBottomSheet( + context: context, + builder: (BuildContext context) { + return SizedBox( + height: 200, + child: Center( + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + GestureDetector( + child: Icon( + Icons.camera_alt_outlined, + size: 100, + color: primaryColor, + ), + onTap: () async { + await takeVideoFromCamera(); + Navigator.pop(context); + }, + ), + SizedBox( + width: MediaQuery.of(context).size.width * .20, + ), + GestureDetector( + child: Icon( + Icons.photo, + size: 100, + color: primaryColor, + ), + onTap: () async { + // await pickVideoFromGallery(); + Navigator.pop(context); + }, + ), + ], + ), + ), + ); + }); + }, + ), + ), + ); + } +} diff --git a/macos/Flutter/GeneratedPluginRegistrant.swift b/macos/Flutter/GeneratedPluginRegistrant.swift index 0a6c0bb..a038202 100644 --- a/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/macos/Flutter/GeneratedPluginRegistrant.swift @@ -5,6 +5,8 @@ import FlutterMacOS import Foundation +import assets_audio_player +import assets_audio_player_web import cloud_firestore import device_info_plus_macos import file_selector_macos @@ -14,10 +16,14 @@ import flutter_local_notifications import geolocator_apple import location import package_info_plus_macos +import path_provider_foundation import shared_preferences_foundation import url_launcher_macos +import wakelock_macos func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { + AssetsAudioPlayerPlugin.register(with: registry.registrar(forPlugin: "AssetsAudioPlayerPlugin")) + AssetsAudioPlayerWebPlugin.register(with: registry.registrar(forPlugin: "AssetsAudioPlayerWebPlugin")) FLTFirebaseFirestorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseFirestorePlugin")) DeviceInfoPlusMacosPlugin.register(with: registry.registrar(forPlugin: "DeviceInfoPlusMacosPlugin")) FileSelectorPlugin.register(with: registry.registrar(forPlugin: "FileSelectorPlugin")) @@ -27,6 +33,8 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { GeolocatorPlugin.register(with: registry.registrar(forPlugin: "GeolocatorPlugin")) LocationPlugin.register(with: registry.registrar(forPlugin: "LocationPlugin")) FLTPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FLTPackageInfoPlusPlugin")) + PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin")) UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin")) + WakelockMacosPlugin.register(with: registry.registrar(forPlugin: "WakelockMacosPlugin")) } diff --git a/pubspec.lock b/pubspec.lock index 16425da..906f81d 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -22,6 +22,20 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.4.1" + assets_audio_player: + dependency: "direct main" + description: + name: assets_audio_player + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.6" + assets_audio_player_web: + dependency: transitive + description: + name: assets_audio_player_web + url: "https://pub.dartlang.org" + source: hosted + version: "3.1.1" async: dependency: transitive description: @@ -37,14 +51,14 @@ packages: source: hosted version: "2.1.0" card_swiper: - dependency: "direct dev" + dependency: "direct main" description: name: card_swiper url: "https://pub.dartlang.org" source: hosted version: "2.0.4" carousel_slider: - dependency: "direct dev" + dependency: "direct main" description: name: carousel_slider url: "https://pub.dartlang.org" @@ -57,6 +71,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.2.1" + charcode: + dependency: transitive + description: + name: charcode + url: "https://pub.dartlang.org" + source: hosted + version: "1.3.1" charts_common: dependency: transitive description: @@ -65,7 +86,7 @@ packages: source: hosted version: "0.12.0" charts_flutter: - dependency: "direct dev" + dependency: "direct main" description: name: charts_flutter url: "https://pub.dartlang.org" @@ -93,7 +114,7 @@ packages: source: hosted version: "1.1.1" cloud_firestore: - dependency: "direct dev" + dependency: "direct main" description: name: cloud_firestore url: "https://pub.dartlang.org" @@ -114,7 +135,7 @@ packages: source: hosted version: "3.7.1" cloudinary_public: - dependency: "direct dev" + dependency: "direct main" description: name: cloudinary_public url: "https://pub.dartlang.org" @@ -163,14 +184,14 @@ packages: source: hosted version: "1.0.5" date_time_picker: - dependency: "direct dev" + dependency: "direct main" description: name: date_time_picker url: "https://pub.dartlang.org" source: hosted version: "2.1.0" day_night_time_picker: - dependency: "direct dev" + dependency: "direct main" description: name: day_night_time_picker url: "https://pub.dartlang.org" @@ -184,7 +205,7 @@ packages: source: hosted version: "0.7.4" device_info_plus: - dependency: "direct dev" + dependency: "direct main" description: name: device_info_plus url: "https://pub.dartlang.org" @@ -226,21 +247,21 @@ packages: source: hosted version: "2.1.1" device_information: - dependency: "direct dev" + dependency: "direct main" description: name: device_information url: "https://pub.dartlang.org" source: hosted version: "0.0.4" dio: - dependency: "direct dev" + dependency: "direct main" description: name: dio url: "https://pub.dartlang.org" source: hosted version: "5.3.3" dots_indicator: - dependency: "direct dev" + dependency: "direct main" description: name: dots_indicator url: "https://pub.dartlang.org" @@ -317,7 +338,7 @@ packages: source: hosted version: "2.8.0" firebase_messaging: - dependency: "direct dev" + dependency: "direct main" description: name: firebase_messaging url: "https://pub.dartlang.org" @@ -337,27 +358,34 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "3.5.7" + flick_video_player: + dependency: "direct main" + description: + name: flick_video_player + url: "https://pub.dartlang.org" + source: hosted + version: "0.5.0" flutter: dependency: "direct main" description: flutter source: sdk version: "0.0.0" flutter_cupertino_datetime_picker: - dependency: "direct dev" + dependency: "direct main" description: name: flutter_cupertino_datetime_picker url: "https://pub.dartlang.org" source: hosted version: "3.0.0" flutter_datetime_picker: - dependency: "direct dev" + dependency: "direct main" description: name: flutter_datetime_picker url: "https://pub.dartlang.org" source: hosted version: "1.5.1" flutter_device_type: - dependency: "direct dev" + dependency: "direct main" description: name: flutter_device_type url: "https://pub.dartlang.org" @@ -378,7 +406,7 @@ packages: source: hosted version: "2.0.2" flutter_local_notifications: - dependency: "direct dev" + dependency: "direct main" description: name: flutter_local_notifications url: "https://pub.dartlang.org" @@ -399,7 +427,7 @@ packages: source: hosted version: "5.0.0" flutter_native_contact_picker: - dependency: "direct dev" + dependency: "direct main" description: name: flutter_native_contact_picker url: "https://pub.dartlang.org" @@ -413,12 +441,40 @@ packages: source: hosted version: "2.0.15" flutter_polyline_points: - dependency: "direct dev" + dependency: "direct main" description: name: flutter_polyline_points url: "https://pub.dartlang.org" source: hosted version: "1.0.0" + flutter_slidable: + dependency: "direct main" + description: + name: flutter_slidable + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0" + flutter_sound: + dependency: "direct main" + description: + name: flutter_sound + url: "https://pub.dartlang.org" + source: hosted + version: "8.5.0" + flutter_sound_platform_interface: + dependency: transitive + description: + name: flutter_sound_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "8.5.0" + flutter_sound_web: + dependency: transitive + description: + name: flutter_sound_web + url: "https://pub.dartlang.org" + source: hosted + version: "8.5.0" flutter_svg: dependency: "direct main" description: @@ -444,14 +500,14 @@ packages: source: sdk version: "0.0.0" fluttertoast: - dependency: "direct dev" + dependency: "direct main" description: name: fluttertoast url: "https://pub.dartlang.org" source: hosted version: "8.2.2" geocoding: - dependency: "direct dev" + dependency: "direct main" description: name: geocoding url: "https://pub.dartlang.org" @@ -521,7 +577,7 @@ packages: source: hosted version: "0.1.3" get: - dependency: "direct dev" + dependency: "direct main" description: name: get url: "https://pub.dartlang.org" @@ -577,7 +633,7 @@ packages: source: hosted version: "0.5.3" google_maps_place_picker_mb: - dependency: "direct dev" + dependency: "direct main" description: name: google_maps_place_picker_mb url: "https://pub.dartlang.org" @@ -619,7 +675,7 @@ packages: source: hosted version: "3.3.0" image_picker: - dependency: "direct dev" + dependency: "direct main" description: name: image_picker url: "https://pub.dartlang.org" @@ -675,7 +731,7 @@ packages: source: hosted version: "0.2.1" intl: - dependency: "direct dev" + dependency: "direct main" description: name: intl url: "https://pub.dartlang.org" @@ -730,6 +786,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "3.1.1" + logger: + dependency: transitive + description: + name: logger + url: "https://pub.dartlang.org" + source: hosted + version: "1.4.0" logging: dependency: transitive description: @@ -766,7 +829,7 @@ packages: source: hosted version: "1.0.4" multi_image_picker: - dependency: "direct dev" + dependency: "direct main" description: name: multi_image_picker url: "https://pub.dartlang.org" @@ -780,7 +843,7 @@ packages: source: hosted version: "1.0.0" overlay_support: - dependency: "direct dev" + dependency: "direct main" description: name: overlay_support url: "https://pub.dartlang.org" @@ -829,7 +892,7 @@ packages: source: hosted version: "1.0.5" path: - dependency: transitive + dependency: "direct main" description: name: path url: "https://pub.dartlang.org" @@ -849,6 +912,27 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.0.1" + path_provider: + dependency: transitive + description: + name: path_provider + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.15" + path_provider_android: + dependency: transitive + description: + name: path_provider_android + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" + path_provider_foundation: + dependency: transitive + description: + name: path_provider_foundation + url: "https://pub.dartlang.org" + source: hosted + version: "2.3.0" path_provider_linux: dependency: transitive description: @@ -871,7 +955,7 @@ packages: source: hosted version: "2.0.7" permission_handler: - dependency: "direct dev" + dependency: "direct main" description: name: permission_handler url: "https://pub.dartlang.org" @@ -913,14 +997,14 @@ packages: source: hosted version: "5.1.0" photo_view: - dependency: "direct dev" + dependency: "direct main" description: name: photo_view url: "https://pub.dartlang.org" source: hosted version: "0.14.0" pinch_zoom: - dependency: "direct dev" + dependency: "direct main" description: name: pinch_zoom url: "https://pub.dartlang.org" @@ -961,6 +1045,20 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "6.0.5" + recase: + dependency: transitive + description: + name: recase + url: "https://pub.dartlang.org" + source: hosted + version: "4.1.0" + rxdart: + dependency: transitive + description: + name: rxdart + url: "https://pub.dartlang.org" + source: hosted + version: "0.27.7" sanitize_html: dependency: transitive description: @@ -969,7 +1067,7 @@ packages: source: hosted version: "2.1.0" shared_preferences: - dependency: "direct dev" + dependency: "direct main" description: name: shared_preferences url: "https://pub.dartlang.org" @@ -1018,7 +1116,7 @@ packages: source: hosted version: "2.3.0" sizer: - dependency: "direct dev" + dependency: "direct main" description: name: sizer url: "https://pub.dartlang.org" @@ -1064,6 +1162,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.1.1" + synchronized: + dependency: transitive + description: + name: synchronized + url: "https://pub.dartlang.org" + source: hosted + version: "3.1.0" term_glyph: dependency: transitive description: @@ -1099,6 +1204,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.3.2" + universal_html: + dependency: transitive + description: + name: universal_html + url: "https://pub.dartlang.org" + source: hosted + version: "2.2.2" universal_io: dependency: transitive description: @@ -1107,7 +1219,7 @@ packages: source: hosted version: "2.2.0" url_launcher: - dependency: "direct dev" + dependency: "direct main" description: name: url_launcher url: "https://pub.dartlang.org" @@ -1176,6 +1288,83 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.1.2" + video_player: + dependency: "direct main" + description: + name: video_player + url: "https://pub.dartlang.org" + source: hosted + version: "2.7.0" + video_player_android: + dependency: transitive + description: + name: video_player_android + url: "https://pub.dartlang.org" + source: hosted + version: "2.4.9" + video_player_avfoundation: + dependency: transitive + description: + name: video_player_avfoundation + url: "https://pub.dartlang.org" + source: hosted + version: "2.4.9" + video_player_platform_interface: + dependency: transitive + description: + name: video_player_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "6.2.0" + video_player_web: + dependency: transitive + description: + name: video_player_web + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.16" + visibility_detector: + dependency: "direct main" + description: + name: visibility_detector + url: "https://pub.dartlang.org" + source: hosted + version: "0.4.0+2" + wakelock: + dependency: transitive + description: + name: wakelock + url: "https://pub.dartlang.org" + source: hosted + version: "0.6.2" + wakelock_macos: + dependency: transitive + description: + name: wakelock_macos + url: "https://pub.dartlang.org" + source: hosted + version: "0.4.0" + wakelock_platform_interface: + dependency: transitive + description: + name: wakelock_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "0.3.0" + wakelock_web: + dependency: transitive + description: + name: wakelock_web + url: "https://pub.dartlang.org" + source: hosted + version: "0.4.0" + wakelock_windows: + dependency: transitive + description: + name: wakelock_windows + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.0" win32: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index abcb80b..66c1b62 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -11,30 +11,20 @@ dependencies: sdk: flutter cupertino_icons: ^1.0.2 - location: ^4.4.0 geolocator: ^9.0.2 google_api_headers: ^1.2.0 google_maps_flutter: ^2.2.3 google_maps_webservice: ^0.0.20-nullsafety.5 - http: ^0.13.5 provider: ^6.0.5 tuple: ^2.0.1 uuid: ^3.0.7 flutter_svg_provider: ^1.0.3 - flutter_svg: ^1.0.1 -dev_dependencies: - flutter_test: - sdk: flutter - - flutter_lints: ^2.0.0 http: ^0.13.5 shared_preferences: ^2.0.15 sizer: ^2.0.11 - geolocator: ^9.0.2 geocoding: ^2.0.4 image_picker: ^0.8.6+1 - flutter_launcher_icons: ^0.11.0 url_launcher: ^6.1.9 intl: ^0.17.0 flutter_svg: ^1.0.1 @@ -51,10 +41,8 @@ dev_dependencies: device_info_plus: ^3.2.4 overlay_support: ^2.1.0 dio: ^5.1.1 - google_maps_flutter: ^2.2.5 flutter_polyline_points: ^1.0.0 get: ^4.6.5 - location: ^4.4.0 permission_handler: ^10.2.0 cloudinary_public: ^0.21.0 carousel_slider: ^4.2.1 @@ -66,6 +54,21 @@ dev_dependencies: multi_image_picker: ^4.8.1 charts_flutter: ^0.12.0 flutter_native_contact_picker: ^0.0.4 + flutter_slidable: ^2.0.0 + video_player: ^2.5.2 + flick_video_player: ^0.5.0 + flutter_sound: ^8.1.9 + assets_audio_player: ^3.0.3+3 + path: ^1.8.0 + visibility_detector: ^0.4.0+2 + +dev_dependencies: + flutter_test: + sdk: flutter + + flutter_lints: ^2.0.0 + flutter_launcher_icons: ^0.11.0 + flutter_icons: image_path_ios: 'images/appicon.png'