From 281bd46f0ace0f7fa5ac1c91ac154d9e6c8e32a0 Mon Sep 17 00:00:00 2001 From: suresh Date: Fri, 1 Sep 2023 15:54:01 +0530 Subject: [PATCH] Add&Offers&Cart Added --- images/01.png | Bin 1792 -> 0 bytes images/02.png | Bin 1052 -> 0 bytes images/03.png | Bin 1373 -> 0 bytes images/04.png | Bin 1653 -> 0 bytes images/05.png | Bin 1331 -> 0 bytes images/06.png | Bin 1340 -> 0 bytes lib/biddingrequests.dart | 276 ++++++++++++++++ lib/dashboard.dart | 38 ++- lib/getmedicines.dart | 177 +++------- lib/inactiveoffersview.dart | 2 +- lib/login.dart | 14 +- lib/medicinecart.dart | 340 ++++++++++++++++++++ lib/medicinedetailspage.dart | 339 +++++++++++++++++++ lib/models/GetMedecineDetailsModel.dart | 6 +- lib/models/biddingrequest_model.dart | 27 ++ lib/models/cartview_model.dart | 57 ++++ lib/models/offersview_model.dart | 4 +- lib/offers.dart | 16 +- lib/{offersdata.dart => offerstabdata.dart} | 129 ++++---- lib/offersview.dart | 2 +- lib/settings.dart | 189 +++++++++++ lib/signup.dart | 22 +- lib/updateprofile.dart | 16 +- pubspec.lock | 7 + pubspec.yaml | 2 +- 25 files changed, 1420 insertions(+), 243 deletions(-) delete mode 100644 images/01.png delete mode 100644 images/02.png delete mode 100644 images/03.png delete mode 100644 images/04.png delete mode 100644 images/05.png delete mode 100644 images/06.png create mode 100644 lib/biddingrequests.dart create mode 100644 lib/medicinecart.dart create mode 100644 lib/medicinedetailspage.dart create mode 100644 lib/models/biddingrequest_model.dart create mode 100644 lib/models/cartview_model.dart rename lib/{offersdata.dart => offerstabdata.dart} (88%) diff --git a/images/01.png b/images/01.png deleted file mode 100644 index 511be2d20418e73bfa171e2d6127dfc249c5b9b9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1792 zcmai#`9Bkk1IO`Vjv6z}kuw@0B4^HJ&1T5VF%NTWlANuPayA~aAuC5r53(Z1llz!k z7Ug`L^&lQshR0ow6yLso!Si~(KcDySpI<&y2YYLvkc~csPqb|&Lj92U!|o2{c4prZkwYFX>Q7&lioBUn_Rgizj9V5 z-%FRmIv9%iF?3RE{)_JN^XaCuv!cwn#CMZ>a+t4Eu^1O8 zwK6mfD{s-#td!lDU$!Odb&8)Ev3Gf z*{f`Oa2U_Y&v|y*k!<4XHUcBABVb$l!9+*&8Tx(;1Zp1J(@+bPW?jqzs+DYP+@HZ@_n zPnEo-+7{~g&0q=i9c@J|CHs%tVSRhxfTrU3+v;Lwf+sOiJRG-yzdpwsnofpOCk$h51KZqe5*1g z@D&AY5$D^_g?`H)+gL7h+5XfCCk!;iR_pcLqRUS2mYBhZD5x9?;<}umeep&7AxcGI zL1HXMmlPeHQVa9Ea=Y^aKmkrb-1$n909$#83b2#)8e}2Q*2>tPRjTz;*$?|g=|rU= zP!kdMvJK3?tL4z2t3INBtA;^*M}j?f3)ZWH?lHt%5<-e`Bpr*#Dm?3gJ>U-6u0MWF zR|2+VD{u0msmp`6ivHb(J<+ZZfGh5o5ENz}J*vEDTqMsRB7Cd%7e^`!ypo|=;%{Vc zC|av|spy8z=!S;pytktF;LVSBA~2D!9WoWPoZ=6);KgZKyy!E|pZhiQe8~>62&?jd zsBa_60e#j+eNTOB8K?@O-`8hyp1Y!aiYX9{+fTwF1&Zy7^>ex64b@PPi|(Pf@f(~z z-wHE?n6y4V9>OBLVyGey2DO%NMnX|42J?{yRkN3mD;F92G8Jsa$iLVMYifn3V$);; z?w=RH=t5r~Xi%BnmR}D(HFkJrs`wDOU%(>431v|KjCI~UrtQucU}*6m&k3fX5!X=} zEIzDQlQ6?ECowUqnPcn#czM)D+mkgwOFfGi`( zrL<3Bg-E*z*_5-R_Cq8s2y-mDNIqS}uw&P#o{ux^B_*LGN}f-v^OU|BkD)ZNSSmc# zW|E|6M;INx<(g53zN4-Q%9I9us~S znzNsbt~*<)>gf(c-c2*h+#tK#lFrI|Z1GRo1E6tB&e|mlAq_)f3_DiD~Hl+-ovdr<%uC6LA8b=QFPsM|nf%g%B9=a}RM&M&npD=AH#i|%h40Hfs zJumJlYI>o*#5QpxBR0#Vx~o^4)c-bZ3))PW+iQV`T95YhgN3^HUkJLnZ?J<)=&9qr zH^w6ZD#>$SqyGGHYU8RxYrsD&=c;?b<2GC9^?>)|}f>Na|T!@*!V7FA-bHz2XBRNQS*ayFfBG2MtR` zc$Vd2igthJ!%ZaZ%6J+f07~Q5iey3Xg$d!copcxD~bC zod#OO4SzBZbIq}=|80DVIS_SSdIjc@Y6vN&;za}3Wtv*UDJP*#l8L z2~JV=*FioiLPCw4Y|_1a6C4s8OcDzW4J{rxBt;Y^7Q8(4NTE|F%PFa3qC*o;8^7>@ zM*ij`gM)gH7EDQKvdH+)A6MCWz5G|<``oLay=PtjcGvFS@9%T|+kU_2Ub{be!h|Wx zDiumhh8+$(N&?LsM-(ubhXXI2IXv^b$hsBm?!9&I(%wxRMaC)hg^8EG z89ceUZrhLSFGUqs>?;l~ThZI;acZTf@>-{-j8%1uC+68z`!1GOektd++v6B3*F29m z3zylikB(k$@#36d;_vyIo!htW)sht86wFy3zfD5E`{AMRcVz+fr~hq#v**RZ*WnrO z{F1`^HJaU*cIocoDw>qE)Rpy$$Y-r0$+nQ=J+i;~nd)DySi6DiXv%^QJpOtUyo#PV z8WemfIp?*@s^C)SoWFllJlAQU)^3_h>7&GGSm~e#B_M#epbUw zp#CW*ZA`rwed-f9lB9sVPRGZ_7vH`KcQsN}SL;=DwmPtVk5tryomK z&WFrr_F)r*&s%mBHnOEnTUq`m*DH5#n1xT`zS-Y@24zj-zsTIbT#kiB1z0 z*ZWw-_uT9(Y&<0Vd1K~9*Xy;rH}~XLs!sYS0!$^Uci9vF{pJvw{O`CxqlAkBn_!3I zYR}t`HP-A-zUW`hZ@OvHzq9-@QLKmdoWJl${q>R3IeV_(4{g0Ba@d!>`MRF^-e4co zj)-jD{m*n(I#tWIi1Ns;miTsOTW$SBy(3E`r?^h2&p%i3^0hfvE{lixG8^BU`;{In zTl!5sIc3(rYZHQi9@!+)EdC&6?)GypUD_3QKb$;&*#|eDS&l48a2H`R+w5mV*j`cl Ty66)y*E4v!`njxgN@xNAP_W#i diff --git a/images/03.png b/images/03.png deleted file mode 100644 index 3d45adc806b830f162b31f005fabd6659a0a1213..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1373 zcmaLX=|2+;00(d}X6Bp+rE+W*>Tx{?$*~%2Y6cv6p zUR;lok&!n-BN0B=c8FOnS8%AE?H2f>)vjJAMXE8mu3Iqq-^%4ePwm%AHBqKQt)jo^ z58i}>Z(Ft(!Y@DiT{*1WBg_~}lf`;h=Zd0bl09%YkrNMtO^jrg9y?-m@&cV+fk| zi>cx<7%(;j>`BX&kk%t{^OaBZXf4lPOFW+&@C zzoSPqQ4F_@MWcMT51LVKaq0O0!j9Q&`(8tKzxiE(V3-y3sT`dX@FIw)f4!-#CgT+_ z5W~70NgP>!<7qeGb+weX&)ecp6GCD`5VXu!m6kS6Z3>@?9&;Ru88iC$DR--)cFCp% zl-yuyDLBMt8#A<~g*KnU zoeI??IpiCX$MLUvB6SgswoHqA5ax^6A&TM5rUHKY?diJ~BmQ(fC!A%TldWFY0XHko zfKESSWn!B5xrDM*A@KUrxlVw|r%w0Q21XR{q7`xQmk{zF3>&J5I^d4IpS1^hkI+XA z(bnWRXZcqq&qo%jtj1wiut<&)M)wf*6ZfulJ5_>!`^4SkK zMf=gD(k__3@7|-~f(uXY<aG6_j8dms26`UB$mi+^Xyknhvp?2)&267cwOY$o>NC36 z%G$)d{i8!*xmamuK}imp?-;OtKvyl$ZZ5E9cDFw+($qs}Q*dPU8;!J$%=)@jgR?Yoh=31C@ z9Y>=Msa7Poyvpc`*L;=ma^nrb#zAYvEmN&irC{-~64RvLZ>u<%guT<97ML`w3LZeRrutmEJ;uiAtzNl3(a)FByBe-t>Ae|M%SmNj+}40*WP+SR8tfu~^hVlqj)Jh^ z&;=I9z?s5Vpt`@G0vjSzvNO*u4L|L%pIV5apTt>b-p*E4L&o=ey#3HqW(HzQ)j&f! zeHLBQF5@l@t^CJ0!A47>C(FLNc;1SAqeau=swq)y*)CKa%Lgo*v4=;Sj38kGYrJrG zl!nH6)Y9#QoG*$b!dTqnv|_3?23mMymlvzj|Cu>p$6$&{u$(_T9Iy^uSXBQ%c>a~? a2e3gthI86Q+wCWtGH5pp^2w1i$$tadh>@iL diff --git a/images/04.png b/images/04.png deleted file mode 100644 index 253192d5ec1388cef6652f46fdc0fd31adefd040..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1653 zcma)-{XY|k1IOjiJjB`3jO$x7$!%j_oq5)*l+D^Awwp7L$K_$=HkpS?CdSMeN#(gj zwv@BTrIt#Y9CeOj!qQ~KH&4|v+rIkx{s;GZy+5DNFQ4B&KYX}Bq=0QEHYR#{dfV_g z|6`kp`@aB2n@(PA575&y^1=IKLo>E4RuhlV$lITxdM~*p2_tfNJv}!XIXl3^`3WH) zVetHcB$%l?kr?sH-;EwKWr+Q-^)CMik5iH@`XjDD9X-WsNEmQn zAly*WqP}1P%}c`(IA%xA z-xMV4sB4;q$)i9210UVb4CvsK2$ze5%clvW`Y5}3kF$b6DQx!6{q;j{kN|Mvd+VV3 zaPvnuBdw&~uhvHYzDKe5S4h()0h%#t=G&L`+FSCdj_|WT40VWBbQj1fC7&W!Ms>&( zwAR$wwU_}E^CZ@Xp}#s}Vc~h-Xp41nPa0h|QJAl^s(?jU*Q~rKV#0$OJXm6ez5?(n znH%F(h|Ov38vEW5zTF<4ZTO+ac!u(wZ9L=}x1&j{n$0V97UX)f@6V|pEcm*NoyL=Z zQo5A=F%{!Tcv5vmh5>~r1L73y{&E`&G4eJ&M0bYb`j&=TmFIq2(5xk`lVsCvIv8m{ zkrZ!*2761&mLHJI0=Zb@3y$VN5~g$NL&=Y9`hX|2-ovhTap%xq*NRdWAfc3FC{r@B zuyJL0=sd)!^wYxHBJlWE>s8litwT^lcj<)o{;-HFmf+BP#3bnZKmltef*J9&!)X z8A}$hhY5cSW}f-UXsT2fy8D|ILLeYF<@a0cEl&BfB!AXiUav}5uBGLCa`s;X3ppB&w6zFu( zlM3C@`(IImY&1VB7Ri6StOT*XyS~z>_ric(n|jY&#GxL(x`)Cjc4?k=Q|*U$tFnF+ zXW5*uv5DxwiOlM<9NP9rvbysSF5t`d-LBn{-=C@xj9*`>5W*^*>Xg_k+2=f}Sd*mj z$uFf`G^@)G>ZQilA{bZc+Hv2$d~r_*J3}LsHk}}st#57peFOs{i@0Mi(GZsJ;113K z8NvqyaF6ctWhrHiS$&b5i2%6_XF#I}=!C6H!O*qg$ zt~o8c;~WYxg+Q;c=I((R##vRWJD*xmowYf3+|Zn|sMkc|{aRFuC7AM#Pt1Q>8W>qf z8ivPRHm{sji?UwNoO)N9XKo7XT)7ys_Ii={)OOcMZ|WXo>0eN?&V6}TaXoJ$_+l)Y zcHZqa>VYlgUkSEd*FW0aYC54trI`^Pn^?EcYrSul#N>-7GXGx3JR>jOu=(B8oK_Lr2^=vp1`CszjiBKUOg{U0uX#Ew8H3V&AOITHXxX(e-nC>b|d;1n!~J zcSC1gxk~|Zjww*hAY$B2LB=zKQITrhodjV;OK?*`%h1n29J>vUl%}jP4n}8-{g`<1 zmPs=Pb+Is{`=nDcpx7^IZ`vzgO(-h zuOno4-!Nl_MGd#}V;QQbvgBf3BA}S3pnR?cL1XOq#=af|vqihLmmypTGghdG=kK-M kto-|H%e5zf#(#nWLyOnXZG;F@H}6Cbe~9GYdLTOYf27?a9RL6T diff --git a/images/05.png b/images/05.png deleted file mode 100644 index e23fe31525de6a7109ba83f854d48b9f18bce2c8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1331 zcmb7^{Xf$Q0LO7Nk9jD?Cd}Mu4yhGhxENnH#QHqB1%*9cSm38`#{P>c z_}d0Z+A#_WpdBv&O{6JG?xB5%fqI!^$C~YsXT9}B>G!?%a6J1)#)0a|nwc<3b+m8L zbj`Hqfz!9lYjbVl-v4TsuhCf*y!Z;8%-{MPz&CRDRPu8&q<7Byzp^|aHyhJ){L<#e+Td+U{yPePBp*tdX#LmG) z?R>)QfaUl^D#|f3MV_EfZERL^*8X{1V9(a@yfQ~d6r^r^`Oehuv#`-5Nj_x~LxA9N z<{8ygSTUhXWmB&ju3AGN@xT-pI$D0h_8JMJhIzeNkIb|@*vh!@D1Sq>e{R4K-$nL# zzR7tgGFUrHddm)IO!W7d#fKm}v_5GR{t&q|mYbLc!^gPO=T|%xU+1N4#D`Io(;669 z8kK$7uB{?mgW>@#DXZ%;Twec$s187eozzKFubI0p$2x4+WWQq~_AM*T`}W_8w|62^ z{hv5=m^@Y zb*>}m5q=>_Yn1K>t4D8#JCELwLp%ln9Uu$x9?VWCw$is~2A{Iv!4tNf)l3Yc_kv$4 z^DbF6BzUafUj)=UdxPz@$NH>PK4q#Kh|5#Ag9=^Uu1)ozhp#4D!@r!IIelj}VK(iM zo35(-h}dW<-5_UV8Znx+se|-xS3|83M{I_tISy6uPH3HAz`=|y0C>sUvn6E3_o0pb z4cV?2q6qC(K}>tok23hY1Lcsjv7mfv;S|Mi=Y)I&c>#t4|~ zBoFgi&B`#6%UY#r*CWr!>A^h(zGbv=Z;M>pRa=yuxBwm67CY#{R)U~LZLCg|ZVQ50 z!*L@S*furdN<@5Zi5FZ`xOsEf&&r%SfV3mMsft@4s}S|>yp=tx+~rTC??g(U+7Brw z<3c#_3uo}3g^?W5V`Frb)eOoJZPRCfD6Sbl>~@R6i%sHY4<+eA{!c{!Sf&M}3{ert S^1b;jh6-LDc%a2CEd3u{&1{zd diff --git a/images/06.png b/images/06.png deleted file mode 100644 index 9e74414d3746fdfc5556b1726c56b7d73855e2a4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1340 zcma)+do&XY0LGO^u~s%^$;~5TVVg4VO4h_M@}?CTce#prztRn_IM?=b2q)gj*h!>z;G}z31FNzVAEd_xE>x_s+Z61CcF%ltFf@kag)2u!-ly+0WVxLj6IQ<9rV+We#N~Jhvj!5qXIHxrlLlgwW zALkcq<1yCVQzC2QZ|w2Fkg)c;-g{7$goI^@EYR+s#8|W9;dfsG;1I!XHHX#!ULSMe z%PVJ{ke<>UR9$0n*)4>x8l|D30b5TeOpj;_9Ppt0zM|&3k#N?R+=1$?ryto!ysovi zWsnPF1eXl^5o|vlTN`eBD~KdTP1o&1gFwRGr^qU(1ik;aN1{Ih!8*01hpzp5`?(y2 z$VdrgBJJDF_uk2i3z~4b8#Q-jam{I!8NU{~hQ^eg24VDHMe7~YFnyv83sE{dPt(aH zIN%N1wrHM5XyQwQRqBa8DQBUqi@}XrgaDtnSy6KnrzYpgu8ep-TG=Rht$^Gk0mFdvdc(4<%7LAyESy(bJS4t~J9q3WQT`0Q9VN+*d9G4#)V*X_p$Sn7cT3Xn?fU zfh*{}c8r>K4sZ@Uo^EWAnt`8>j>Er9W^{9fPIv%8m{0rOmN4FNN&z$U3*fbG=VRZ^ z%R=2G6Q5>^#gYhG-9?OzCnLB^MhAEoJg!O3^sXfvFoPBDAbRub;}6YVQjU5Nv-0K% zm#e0k0GXxy6n%s{RyZS!ik`3BEV5WKfEtww&&G2q(Po1rZ>!_HUVpNqJs|;Lk3xf$^(8peaLc7GlJrsaW zo(4f!rqhJHxMD6zHK0DIy&u%Lec4r`N~ahbs*7kuHS@7HjpaGNHe$PjVg73DQx*0^)zI}()-QTXv3{u`R}9|pPeNMV-}gJ z!Sld)3Mgw3(ToKP^ItGoa_mvlq_Fo3Gn?V4K52vdMH;qJkv2F%uNMz7m!o;E?9OyL o2;2VGc!PvF`TsofuW?d0omw0V%QQ6 createState() => _BiddingRequestsState(); +} + +class _BiddingRequestsState extends State { + String Url = ''; + List prescriptionsList = []; + List prescriptionsListOriginal = []; + bool isPrescriptionsDataLoading = false; + bool isSereverIssue = false; + bool isLoading=false; + + + + Future getAllPrescriptions() async { + isPrescriptionsDataLoading=true; + try { + var response = await AppSettings.getAllBiddingRecords(); + print(response); + setState(() { + prescriptionsList = + ((jsonDecode(response)['data']) as List).map((dynamic model) { + return BiddingRequestsModel.fromJson(model); + }).toList(); + isPrescriptionsDataLoading = false; + }); + + + } catch (e) { + setState(() { + isLoading = false; + isPrescriptionsDataLoading = false; + }); + } + } + + @override + void initState() { + getAllPrescriptions(); + //getAllPharmaciesData(dropdownArea); + 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 _allPrescriptions(){ + if (prescriptionsList.length != 0) { + return Column( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Expanded(child:ListView.builder( + padding: EdgeInsets.all(0), + itemCount: prescriptionsList.length, + itemBuilder: (BuildContext context, int index) { + return GestureDetector( + onTap: (){ + Navigator.push( + context, + new MaterialPageRoute( + builder: (__) => new GetMedicines(medicinebookingid:prescriptionsList[index].bidding_bookingid))); + }, + child: Card( + + //color: prescriptionsList[index].cardColor, + child: Padding( + padding:EdgeInsets.all(8) , + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + GestureDetector( + child: Container( + width: MediaQuery.of(context).size.width * .18, + height: + MediaQuery.of(context).size.height * .10, + decoration: BoxDecoration( + shape: BoxShape.circle, + image: DecorationImage( + image: (AppSettings.updatedImage != null) ? FileImage(AppSettings.updatedImage!) as ImageProvider : AssetImage("images/mobilebg.png"), // picked file + fit: BoxFit.cover)), + /* decoration: BoxDecoration( + shape: BoxShape.rectangle, + image: DecorationImage( + image: NetworkImage(prescriptionsList[index].prescription_url) as ImageProvider, // picked file + fit: BoxFit.contain)),*/ + ), + onTap: (){ + // showPicDialog(prescriptionsList[index].prescription_url); + + }, + ), + SizedBox(width:MediaQuery.of(context).size.width * .02,), + Container( + width: MediaQuery.of(context).size.width * .55, + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text(prescriptionsList[index].custumerid_bidding.toString().toUpperCase(),style: valuesTextStyle()), + Text(prescriptionsList[index].pharmacyid_bidding.toString().toUpperCase(),style: valuesTextStyle()), + Text(prescriptionsList[index].amount_bidding.toString().toUpperCase(),style: valuesTextStyle()), + Text(prescriptionsList[index].bidding_bookingid.toString().toUpperCase(),style: valuesTextStyle()), + + ], + ), + + + ), + + Visibility( + //visible:offersviewList[index].orderStatus.toString().toLowerCase()=='pending', + child: Column( + children: [ + TextButton( + child: Text( + 'Accept', + style: TextStyle( + fontSize: 15, + color: + primaryColor /*FilteredList[index].text_color*/), + ), + onPressed: () async { + var payload = new Map(); + payload["customerId"] = prescriptionsList[index].custumerid_bidding.toLowerCase(); + payload["pharmacyId"] =AppSettings.healthpharmaIdsign.toLowerCase(); + bool requestStatus = + await AppSettings.getRequestBiddingDetails( + prescriptionsList[index].bidding_bookingid.toLowerCase(), + payload); + if(requestStatus){ + AppSettings.longSuccessToast("Request Accepted Successfully"); + await getAllPrescriptions(); + } + else{ + } + + }, + ), + TextButton( + child: Text( + 'Reject', + style: TextStyle( + fontSize: 15, + color: + primaryColor /*FilteredList[index].text_color*/), + ), + onPressed: () async { + + + + + + }, + ), + ], + )) + + ], + + ), + /*TextButton( + child: const Text( + 'Order Medicines', + style: TextStyle(color: primaryColor), + ), + onPressed: () { + + Navigator.push( + context, + new MaterialPageRoute( + builder: (__) => new OrderMedicines(prescriptionDetails:prescriptionsList[index]))); + //signup screen + }, + )*/ + ], + ), + ), + ), + ); + }) ), + + + + + + ]); + } + 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,), + + ], + ), + ) + ); + } + } + + /**/ + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppSettings.appBar('BiddingRequests'), + body: isPrescriptionsDataLoading?Center( + child: CircularProgressIndicator( + color: primaryColor, + strokeWidth: 5.0, + ), + ): _allPrescriptions(), + ); + } +} diff --git a/lib/dashboard.dart b/lib/dashboard.dart index 788a524..d245e33 100644 --- a/lib/dashboard.dart +++ b/lib/dashboard.dart @@ -5,9 +5,11 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:healthcare_pharmacy/getmedicines.dart'; import 'package:healthcare_pharmacy/inactiveoffersview.dart'; +import 'package:healthcare_pharmacy/medicinecart.dart'; import 'package:healthcare_pharmacy/offers.dart'; -import 'package:healthcare_pharmacy/offersdata.dart'; +import 'package:healthcare_pharmacy/offerstabdata.dart'; import 'package:healthcare_pharmacy/offersview.dart'; +import 'package:healthcare_pharmacy/biddingrequests.dart'; import 'package:healthcare_pharmacy/updateprofile.dart'; import 'package:image_picker/image_picker.dart'; import 'package:carousel_slider/carousel_slider.dart'; @@ -119,7 +121,22 @@ class _DashboardState extends State { child: Column( children: [ - CarouselSlider( + Container( + height: MediaQuery.of(context).size.height * .250, + width: double.infinity, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(0), + ), + //color: Colors.red, + child: FittedBox( + child:Image( + image: const AssetImage('images/mobilebg2.png'), + + ), + fit: BoxFit.fill, + ) + ), + /*CarouselSlider( options: CarouselOptions( height: MediaQuery.of(context).size.height * .250, aspectRatio: 16 / 9, @@ -154,7 +171,7 @@ class _DashboardState extends State { }, ); }).toList(), - ), + ),*/ SizedBox(height: 5), Expanded(child: Container( padding: EdgeInsets.all(12.0), @@ -334,6 +351,7 @@ class _DashboardState extends State { MediaQuery.of(context).size.height * .25, decoration: BoxDecoration( shape: BoxShape.rectangle, + border: Border.all(width: 2 , color: Colors.blueGrey), image: DecorationImage( image: (AppSettings.profilePictureUrl != '' && @@ -607,7 +625,7 @@ class _DashboardState extends State { Divider( color: Colors.grey, ), - /*ListTile( + ListTile( title: Row( children: const [ Image( @@ -618,7 +636,7 @@ class _DashboardState extends State { const SizedBox( width: 10, ), - Text('InActiveOffersView', style: TextStyle(color: Colors.black)), + Text('BiddingRequests', style: TextStyle(color: Colors.black)), ], ), onTap: () { @@ -626,7 +644,7 @@ class _DashboardState extends State { Navigator.push( context, MaterialPageRoute( - builder: (context) => const InActiveOffersView()), + builder: (context) => MedicineCartList()), ); @@ -635,8 +653,8 @@ class _DashboardState extends State { ), Divider( color: Colors.grey, - ),*/ - ListTile( + ), + /* ListTile( title: Row( children: const [ Image( @@ -655,7 +673,7 @@ class _DashboardState extends State { Navigator.push( context, MaterialPageRoute( - builder: (context) => const GetMedicines()), + builder: (context) => GetMedicines()), ); @@ -664,7 +682,7 @@ class _DashboardState extends State { ), Divider( color: Colors.grey, - ), + ),*/ ListTile( title: Row( children: const [ diff --git a/lib/getmedicines.dart b/lib/getmedicines.dart index fa01e1f..f355303 100644 --- a/lib/getmedicines.dart +++ b/lib/getmedicines.dart @@ -2,6 +2,7 @@ import 'dart:convert'; import 'dart:io'; import 'package:flutter/material.dart'; import 'package:geolocator/geolocator.dart'; +import 'package:healthcare_pharmacy/medicinedetailspage.dart'; import 'package:healthcare_pharmacy/models/GetMedecineDetailsModel.dart'; import 'package:healthcare_pharmacy/settings.dart'; import 'package:flutter/services.dart'; @@ -11,7 +12,11 @@ import 'package:photo_view/photo_view.dart'; class GetMedicines extends StatefulWidget { - const GetMedicines({Key? key}) : super(key: key); + var medicinebookingid; + + GetMedicines({ + this.medicinebookingid + }); @override State createState() => _GetMedicinesState(); @@ -30,6 +35,8 @@ class _GetMedicinesState extends State with TickerProviderStateMix String medicine_salt_composition=''; String medicine_mrp=''; String medicine_primary_use=''; + String medbookingid = ''; + List medImages=[]; @@ -79,10 +86,10 @@ class _GetMedicinesState extends State with TickerProviderStateMix void initState() { // TODO: implement initState super.initState(); + medbookingid=widget.medicinebookingid; } - showPicDialog(var imageUrl){ return showDialog( context: context, @@ -124,121 +131,6 @@ class _GetMedicinesState extends State with TickerProviderStateMix ); } - - - /*Widget _bindMedicines(){ - if (medecineList.length != 0) { - return Column( - crossAxisAlignment: CrossAxisAlignment.end, - children: [ - Expanded(child:ListView.builder( - padding: EdgeInsets.all(0), - itemCount: medecineList.length, - itemBuilder: (BuildContext context, int index) { - return Card( - - //color: prescriptionsList[index].cardColor, - child: Padding( - padding:EdgeInsets.all(8) , - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - GestureDetector( - 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(medImages[0]) as ImageProvider, // picked file - fit: BoxFit.contain)), - ), - onTap: (){ - showPicDialog(medImages[0]); - - }, - ), - SizedBox(width:MediaQuery.of(context).size.width * .02,), - - Container( - width: MediaQuery.of(context).size.width * .55, - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text(("Name :"+ medicine_name).toString().toUpperCase(),style: valuesTextStyle()), - Text(("Manufacturers :"+ medicine_manufacturers).toString().toUpperCase(),style: valuesTextStyle()), - Text(("Estimate Price :"+ medicine_mrp).toString().toUpperCase(),style: valuesTextStyle()), - Text(("Medicine_Use :"+ medicine_primary_use).toString().toUpperCase(),style: valuesTextStyle()), - ], - ), - - - ), - - ], - - ), - ], - ), - ), - ); - }) ), - ]); - } - else{ - return Center( - child: Padding( - padding: EdgeInsets.fromLTRB(0, 40, 0, 0), - child: isSereverIssue - ? Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - SizedBox( - height: 20, - ), - Text( - 'No medicine found with your search',style:serverIssueTextStyle() ,), - ], - ) - : userAddress==''?Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Icon(Icons.search,color: primaryColor,size: 40,), - SizedBox( - height: 20, - ), - Text( - 'Please enter atleast 4 letters to continue search',style:TextStyle( - color: primaryColor, - fontWeight: FontWeight.bold, - ),), - ], - ): - Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Icon(Icons.dataset_rounded,color: primaryColor,size: 40,), - SizedBox( - height: 20, - ), - SizedBox( - height: 20, - ), - Text( - 'No medicine found with your search',style:serverIssueTextStyle() ,), - ], - ), - )); - } - }*/ - - Widget _bindMedicines() { if (medicine_name!='') { return Padding(padding: EdgeInsets.all(10), @@ -260,29 +152,48 @@ class _GetMedicinesState extends State with TickerProviderStateMix image: NetworkImage(medImages[0]) as ImageProvider, // picked file fit: BoxFit.contain)), ), - onTap: (){ + onTap: () async { showPicDialog(medImages[0]); }, ), + GestureDetector( + child: Column( + children: [ + Text(("Name :"+ medicine_name), + style: TextStyle(fontWeight: FontWeight.bold), + ), + Text(("Manufacturers :"+ medicine_manufacturers), + style: TextStyle(fontWeight: FontWeight.bold), + ), + Text( + medicine_salt_composition, + style: TextStyle(fontWeight: FontWeight.bold), + ), + Text(("Estimate Price :"+ medicine_mrp), + style: TextStyle(fontWeight: FontWeight.bold), + ), + Text(("Medicine_Use :"+ medicine_primary_use), + style: TextStyle(fontWeight: FontWeight.bold), + ), + ], + ), + onTap: () { + /* Navigator.push( + context, + new MaterialPageRoute( + builder: (__) => new MedicineDetailsCount()));*/ + Navigator.push( + context, + new MaterialPageRoute( + builder: (__) => new MedicineDetails(name: medicine_name,price: medicine_mrp,bookid:medbookingid))); + }, + + - Text(("Name :"+ medicine_name), - style: TextStyle(fontWeight: FontWeight.bold), - ), - Text(("Manufacturers :"+ medicine_manufacturers), - style: TextStyle(fontWeight: FontWeight.bold), - ), - Text( - medicine_salt_composition, - style: TextStyle(fontWeight: FontWeight.bold), - ), - Text(("Estimate Price :"+ medicine_mrp), - style: TextStyle(fontWeight: FontWeight.bold), - ), - Text(("Medicine_Use :"+ medicine_primary_use), - style: TextStyle(fontWeight: FontWeight.bold), ), + ], ), diff --git a/lib/inactiveoffersview.dart b/lib/inactiveoffersview.dart index ddcc896..babf68f 100644 --- a/lib/inactiveoffersview.dart +++ b/lib/inactiveoffersview.dart @@ -114,7 +114,7 @@ class _InActiveOffersViewState extends State with TickerProv Text(offersviewList[index].offer_name,style: valuesTextStyle()), Text(offersviewList[index].offer_code,style: valuesTextStyle()), Text(offersviewList[index].description,style: valuesTextStyle()), - Text(offersviewList[index].discount_percentage,style: valuesTextStyle()), + Text(offersviewList[index].offer,style: valuesTextStyle()), Text(offersviewList[index].starting_date,style: valuesTextStyle()), Text(offersviewList[index].ending_date,style: valuesTextStyle()) diff --git a/lib/login.dart b/lib/login.dart index 81476b9..2d9f8b4 100644 --- a/lib/login.dart +++ b/lib/login.dart @@ -88,7 +88,7 @@ class _LoginState extends State { child: Column( children: [ const SizedBox( - height: 15, + height: 55, ), Container( //width: double.infinity, @@ -107,12 +107,8 @@ class _LoginState extends State { keyboardType: TextInputType.number, maxLength: 10, decoration: textFormFieldDecoration(Icons.phone,'Enter MobileNumber'), - ), ), - const SizedBox( - height: 15, - ), Container( padding: const EdgeInsets.fromLTRB(10, 10, 10, 0), @@ -207,13 +203,13 @@ class _LoginState extends State { MaterialPageRoute( builder: (context) => const Dashboard()), ); - // AppSettings.longSuccessToast("Logged in Successfully"); + AppSettings.longSuccessToast("Logged in Successfully"); mobileNumberController.text=''; passwordController.text=''; } else { Navigator.of(context,rootNavigator: true).pop(); - //AppSettings.longFailedToast("Please enter valid details"); + AppSettings.longFailedToast("Please enter valid details"); } } catch(exception){ @@ -223,14 +219,14 @@ class _LoginState extends State { } else{ Navigator.of(context,rootNavigator: true).pop(); - // AppSettings.longFailedToast("Please Check internet"); + AppSettings.longFailedToast("Please Check internet"); } } else{ - //AppSettings.longFailedToast("Please enter valid details"); + AppSettings.longFailedToast("Please enter valid details"); } }, diff --git a/lib/medicinecart.dart b/lib/medicinecart.dart new file mode 100644 index 0000000..e7f65b5 --- /dev/null +++ b/lib/medicinecart.dart @@ -0,0 +1,340 @@ +import 'dart:convert'; +import 'package:flutter/material.dart'; +import 'package:healthcare_pharmacy/biddingrequests.dart'; +import 'package:healthcare_pharmacy/dashboard.dart'; +import 'package:healthcare_pharmacy/getmedicines.dart'; +import 'package:healthcare_pharmacy/maps/app_colors.dart'; +import 'package:healthcare_pharmacy/medicinedetailspage.dart'; +import 'package:healthcare_pharmacy/models/biddingrequest_model.dart'; +import 'package:healthcare_pharmacy/models/cartview_model.dart'; +import 'package:healthcare_pharmacy/models/offersview_model.dart'; +import 'package:healthcare_pharmacy/settings.dart'; +import 'package:intl/intl.dart'; +import 'package:flutter_cupertino_datetime_picker/flutter_cupertino_datetime_picker.dart'; + + +class MedicineCartList extends StatefulWidget { + var bookidcart; + + MedicineCartList({ + this.bookidcart + }); + + @override + State createState() => _MedicineCartListState(); +} + +class _MedicineCartListState extends State with TickerProviderStateMixin { + bool isSupplierDataLoading=false; + bool isSereverIssue = false; + bool isSereverIssueConnected = false; + bool isSereverIssuePending = false; + var startdate; + var enddate; + String totalPrice=''; + String medicinetime=''; + + String bookingidstring=''; + bool isLoading=false; + + + + + List offersviewList = []; + TextEditingController medicine_nameController = TextEditingController(); + TextEditingController medicine_quantityController = TextEditingController(); + TextEditingController medicine_priceController = TextEditingController(); + TextEditingController medicine_timingsController = TextEditingController(); + + + Future getCartViewData() async { + isLoading = true; + + try { + var response = await AppSettings.getCartDetails(widget.bookidcart).then((value){ + setState(() { + // offersviewList = BiddingCartviewModel.fromJson(response['items']) as List; + offersviewList = + ((jsonDecode(value)['items']) as List).map((dynamic model) { + return BiddingCartviewModel.fromJson(model); + }).toList(); + + totalPrice=jsonDecode(value)['totalPrice'].toString(); + + print(medicinetime); + print(totalPrice); + isLoading = false; + }); + }); + print("offersviewListdata${jsonDecode(response)}"); + + } catch (e) { + setState(() { + isLoading = false; + isSereverIssueConnected = true; + }); + } + } + + + + @override + void initState() { + // TODO: implement initState + getCartViewData(); + super.initState(); + } + + Widget renderzUi() { + if (offersviewList.length != 0) { + return Column(crossAxisAlignment: CrossAxisAlignment.end, children: [ + Expanded( + child: ListView.builder( + padding: EdgeInsets.all(0), + itemCount: offersviewList.length, + itemBuilder: (BuildContext context, int index) { + return Card( + child: Padding( + padding: EdgeInsets.all(8), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Expanded( + child: Container( + width: MediaQuery.of(context).size.width * .70, + child: Row( + children: [ + Column( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Text('MedicineName:', + style: labelTextStyle()), + SizedBox( + height: 10, + ), + Text( + 'Medicine Timings:', + style: labelTextStyle()), + SizedBox( + height: 10, + ), + Text('MedicineQuantity:', + style: labelTextStyle()), + SizedBox( + height: 10, + ), + Text('MedicinePrice:', + style: labelTextStyle()), + ], + ), + SizedBox( + width: 10, + ), + Column( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + SizedBox( + height: 12, + ), + Text( + offersviewList[index].medicinename_bidding! + .toUpperCase(), + style: valuesTextStyle()), + SizedBox( + height: 12, + ), + Text( + offersviewList[index].medicine_timings![0].medicineTimings!.toUpperCase(), + style: valuesTextStyle()), + SizedBox( + height: 10, + ), + Text( + offersviewList[index].quantity_bidding.toString() + .toUpperCase(), + style: valuesTextStyle()), + SizedBox( + height: 10, + ), + Text( + offersviewList[index].price_bidding.toString() + .toUpperCase(), + style: valuesTextStyle()), + SizedBox( + height: 10, + ), + ], + ), + ], + )), + ), + + ], + ), + ), + ); + })), + + Container( + width: 400, + height: 50, + padding: const EdgeInsets.fromLTRB(10, 0, 10, 0), + child:TextButton( + onPressed: () { + // Add your button click logic here + }, + child: Text( + 'Total Price:$totalPrice', + style: TextStyle( + fontSize: 20, + color: AppColors.primaryColor, // Text color + decoration: TextDecoration.underline, // Underline the text + fontWeight: FontWeight.bold, // Bold text + ), + ), + ),), + SizedBox( + height: 10, + ), + Container( + width: 400, + height: 50, + padding: const EdgeInsets.fromLTRB(10, 0, 10, 0), + child: ElevatedButton( + style: ElevatedButton.styleFrom( + primary: primaryColor, // background + onPrimary: Colors.white, // foreground + ), + onPressed: () async{ + + }, + child: Text('CheckOut'), + )), + + + + /*Column( + children: [ + Padding(padding: const EdgeInsets.fromLTRB(10, 10,10,10), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + const Text( + 'Add More', + style: TextStyle( + color: Colors.white, + ), + ), + TextButton( + child: const Text( + 'Sign Up', + style: TextStyle(fontSize: 15, + decoration: TextDecoration.underline,color: Colors.white), + ), + onPressed: () { + *//* Navigator.push( + context, + MaterialPageRoute( + builder: (context) => const SignUp()), + );*//* + //signup screen + }, + ) + ], + ),) + Container( + width: 400, + height: 50, + padding: const EdgeInsets.fromLTRB(10, 0, 10, 0), + child:TextButton( + onPressed: () { + // Add your button click logic here + }, + child: Text( + 'Total Price:$totalPrice', + style: TextStyle( + fontSize: 20, + color: AppColors.primaryColor, // Text color + decoration: TextDecoration.underline, // Underline the text + fontWeight: FontWeight.bold, // Bold text + ), + ), + ),), + SizedBox( + height: 10, + ), + Container( + width: 400, + height: 50, + padding: const EdgeInsets.fromLTRB(10, 0, 10, 0), + child: ElevatedButton( + style: ElevatedButton.styleFrom( + primary: primaryColor, // background + onPrimary: Colors.white, // foreground + ), + onPressed: () async{ + + }, + child: Text('CheckOut'), + )), + ], + )*/ + + + + ]); + } 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 Found'), + SizedBox( + height: 20, + ), + ], + ), + )); + } + } + + @override + Widget build(BuildContext context) { + return SafeArea( + child: Scaffold( + appBar: AppBar( + // Add a back button to the leading property + backgroundColor: primaryColor, + leading: IconButton( + icon: Icon(Icons.arrow_back), // You can use a different back icon if needed + onPressed: () { + // Implement the navigation logic to go back + Navigator.push( + context, + MaterialPageRoute(builder: (context) => BiddingRequests()), + ); // This will pop the current route and go back + }, + ), + title: Text('Cart Details'), + ), + body: isLoading?Center( + child: CircularProgressIndicator( + color: primaryColor, + strokeWidth: 5.0, + ), + ):renderzUi(), + )); + } +} \ No newline at end of file diff --git a/lib/medicinedetailspage.dart b/lib/medicinedetailspage.dart new file mode 100644 index 0000000..53c06da --- /dev/null +++ b/lib/medicinedetailspage.dart @@ -0,0 +1,339 @@ + +import 'dart:convert'; + +import 'package:flutter/material.dart'; +import 'package:google_maps_flutter/google_maps_flutter.dart'; +import 'package:healthcare_pharmacy/medicinecart.dart'; +import 'package:healthcare_pharmacy/settings.dart'; +import 'package:quantity_input/quantity_input.dart'; +import 'package:flutter/services.dart'; +import 'dart:io' show File, Platform; +import 'package:location/location.dart' as locationmap; + + +class MedicineDetails extends StatefulWidget { + var name; + var price; + var bookid; + + MedicineDetails({ + this.name,this.price,this.bookid + }); + + @override + State createState() => _deliverboyState(); +} + +class _deliverboyState extends State { + + + TextEditingController MedicineNameController = TextEditingController(); + TextEditingController MedicineQuantityController = TextEditingController(); + TextEditingController MedicinePriceController = TextEditingController(); + TextEditingController BookingidController = TextEditingController(); + String selectedOptionsText = ''; + List medicineCheckboxes = ["BB","AB","BL","AL","BD","AD"]; + String medname = ''; + String medprice = ''; + int initialValue = 0; + double enteredValue = 0.0; + + + @override + void initState() { + super.initState(); + MedicineNameController.text=widget.name; + MedicinePriceController.text=widget.price; + BookingidController.text=widget.bookid; + } + + double getTotalAmount() { + return enteredValue * initialValue; + } + + void toggleOption(String option) { + setState(() { + if (selectedOptionsText.contains(option)) { + selectedOptionsText = selectedOptionsText + .replaceAll('$option,', '') // Remove option from the string + .replaceAll(', $option', '') // Remove option from the string + .trim(); // Remove leading/trailing spaces + } else { + if (selectedOptionsText.isEmpty) { + selectedOptionsText = option; + } else { + selectedOptionsText += ', $option'; + } + } + }); + } + @override + Widget build(BuildContext context) { + return Scaffold( + appBar:AppSettings.appBar('Medicine Details'), + body: SafeArea( + child: SingleChildScrollView( + child: Column( + children: [ + const SizedBox( + height: 15, + ), + Container( + height: MediaQuery.of(context).size.height * .15, + width: double.infinity, + child: Image( + image: const AssetImage('images/logo.png'), + height: MediaQuery.of(context).size.height * .25, + )), + const SizedBox( + height: 15, + ), + Container( + //padding: const EdgeInsets.fromLTRB(10, 10, 10, 0), + padding: const EdgeInsets.all(10), + child: TextFormField( + cursorColor: greyColor, + controller: MedicineNameController, + textCapitalization: TextCapitalization.characters, + decoration: const InputDecoration( + prefixIcon: Icon( + Icons.medical_information, + color: greyColor, + ), + border: OutlineInputBorder( + borderSide: BorderSide(color: greyColor)), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide(color: greyColor), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide(color: greyColor), + ), + labelText: 'Medicine Name', + labelStyle: TextStyle( + color: greyColor, //<-- SEE HERE + ), + ), + ), //tanker name + ), + const SizedBox( + height: 15, + ), + ListView.builder( + shrinkWrap: true, + itemCount: (medicineCheckboxes.length / 2).ceil(), // Assuming 2 columns + itemBuilder: (context, index) { + final start = index * 2; + final end = start + 2 > medicineCheckboxes.length + ? medicineCheckboxes.length + : start + 2; + + return Row( + children: [ + for (int i = start; i < end; i++) + Expanded( + child: CheckboxListTile( + value: selectedOptionsText.contains(medicineCheckboxes[i]), + onChanged: (value) => toggleOption(medicineCheckboxes[i]), + title: Text(medicineCheckboxes[i]), + controlAffinity: ListTileControlAffinity.leading, + dense: true, + contentPadding: EdgeInsets.zero, + ), + ), + ], + ); + }, + ), + + + const SizedBox( + height: 5, + ), + Container( + //padding: const EdgeInsets.fromLTRB(10, 10, 10, 0), + padding: const EdgeInsets.all(10), + child: TextFormField( + cursorColor: greyColor, + controller: MedicineQuantityController, + readOnly: true, + textCapitalization: TextCapitalization.characters, + decoration: const InputDecoration( + prefixIcon: Icon( + Icons.production_quantity_limits, + color: greyColor, + ), + border: OutlineInputBorder( + borderSide: BorderSide(color: greyColor)), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide(color: greyColor), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide(color: greyColor), + ), + labelText: 'Medicine Quantity', + labelStyle: TextStyle( + color: greyColor, //<-- SEE HERE + ), + ), + ), //tanker name + ), + //phone number + const SizedBox( + height: 5, + ), + Container( + //padding: const EdgeInsets.fromLTRB(10, 10, 10, 0), + padding: const EdgeInsets.all(10), + child: TextFormField( + cursorColor: greyColor, + controller: MedicinePriceController, + textCapitalization: TextCapitalization.characters, + decoration: const InputDecoration( + prefixIcon: Icon( + Icons.currency_rupee, + color: greyColor, + ), + border: OutlineInputBorder( + borderSide: BorderSide(color: greyColor)), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide(color: greyColor), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide(color: greyColor), + ), + labelText: 'Medicine Price', + labelStyle: TextStyle( + color: greyColor, //<-- SEE HERE + ), + ), + ), //tanker name + ), //alternative phone number + const SizedBox( + height: 5, + ), + Container( + height: MediaQuery.of(context).size.height * .1, + width: MediaQuery.of(context).size.width * .5, + child: Column( + children: [ + QuantityInput( + label: 'Select Medicine Quntity', + value: initialValue, + iconColor: Colors.white, + buttonColor: primaryColor, + onChanged: (value) { + setState(() { + enteredValue = double.tryParse(value) ?? 0.0; + initialValue = int.parse(value.replaceAll(',', '')); + MedicineQuantityController.text=initialValue.toString(); + // MedicinePriceController.text= '${getTotalAmount()}'; + }); + } + + + + ), + ] + ) //tanker name + ), //alternative phone number + const SizedBox( + height: 5, + ), + + Container( + width: MediaQuery.of(context).size.width * .99, + height: 50, + padding: const EdgeInsets.fromLTRB(10, 0, 10, 0), + child: ElevatedButton( + style: ElevatedButton.styleFrom( + primary: primaryColor, // background + onPrimary: Colors.white, // foreground + ), + onPressed: () async { + if (MedicineNameController.text != '' && + MedicineQuantityController.text != ''&& + MedicinePriceController.text != '' + ) { + AppSettings.preLoaderDialog(context); + /* var payload = new Map(); + payload["mbookingId"] = BookingidController.text.toString(); + payload["items"]=[{ + "medicinename":MedicineNameController.text.toString(), + "quantity":MedicineQuantityController.text.toString(), + "price":MedicinePriceController.text.toString() + }]; + print("responcedata${payload.toString()}");*/ + + var response = await AppSettings.addToCart(BookingidController.text,MedicineQuantityController.text, + MedicinePriceController.text,MedicineNameController.text,selectedOptionsText); + + //String response= await addToCart("OR1690969760576127","10","300","Dolo650"); + + //print("response$response"); + try { + if(response.statusCode==200){ + var msg=jsonDecode(response.body)['message']; + print(msg); + Navigator.of(context,rootNavigator: true).pop(); + AppSettings.longSuccessToast( + "Medicine Added to Cart Successfully"); + /* MedicineNameController.text = ''; + MedicineQuantityController.text = ''; + MedicinePriceController.text = ''; + //BookingidController.text = '';*/ + await Navigator.push( + context, + MaterialPageRoute( + builder: (context) => MedicineCartList(bookidcart:BookingidController.text.toString())), + ); + + + } + else{ + Navigator.of(context,rootNavigator: true).pop(); + AppSettings.longFailedToast("Medicine Not Added to Cart Successfully"); + } + + /* try { + if (medicineStatus) { + Navigator.of(context,rootNavigator: true).pop(); + AppSettings.longSuccessToast( + "Medicine Added to Cart Successfully"); + *//* MedicineNameController.text = ''; + MedicineQuantityController.text = ''; + MedicinePriceController.text = ''; + //BookingidController.text = '';*//* + await Navigator.push( + context, + MaterialPageRoute( + builder: (context) => MedicineCartList(bookidcart:BookingidController.text.toString())), + ); + + //Navigator.of(context).pushNamed('/tanksview'); + } else { + Navigator.of(context,rootNavigator: true).pop(); + AppSettings.longFailedToast("Medicine Not Added to Cart Successfully"); + }*/ + } catch (exception) { + print(exception); + } + } + else { + AppSettings.longFailedToast("Please enter valid details"); + } + }, + + child: const Text( + 'NEXT', + style: TextStyle( + fontSize: 25, + ), + ), + )), + + ], + ), + )), + ); + } +} diff --git a/lib/models/GetMedecineDetailsModel.dart b/lib/models/GetMedecineDetailsModel.dart index bfbd260..2facde4 100644 --- a/lib/models/GetMedecineDetailsModel.dart +++ b/lib/models/GetMedecineDetailsModel.dart @@ -22,9 +22,9 @@ class GetMedecineDetailsModel { GetMedecineDetailsModel rtvm = new GetMedecineDetailsModel(); rtvm.name = json['name'] ?? ''; - rtvm.manufacturers = json['manufacturers'] ?? ''; - rtvm.salt_composition = json['salt_composition'] ?? ''; - rtvm.mrp = json['mrp'] ?? ''; + rtvm.manufacturers = json['manufacturers'].toString() ?? ''; + rtvm.salt_composition = json['salt_composition'].toString() ?? ''; + rtvm.mrp = json['mrp'].toString() ?? ''; rtvm.primary_use = json['primary_use'] ??''; rtvm.picture = json['picture'] ?? ''; diff --git a/lib/models/biddingrequest_model.dart b/lib/models/biddingrequest_model.dart new file mode 100644 index 0000000..6af567e --- /dev/null +++ b/lib/models/biddingrequest_model.dart @@ -0,0 +1,27 @@ +import 'package:flutter/material.dart'; + +class BiddingRequestsModel { + String custumerid_bidding = ''; + String pharmacyid_bidding=''; + String amount_bidding=''; + String bidding_bookingid=''; + + Color cardColor=Colors.white; + + + BiddingRequestsModel(); + + factory BiddingRequestsModel.fromJson(Map json){ + BiddingRequestsModel rtvm = new BiddingRequestsModel(); + + rtvm.custumerid_bidding = json['customerId'].toString() ??''; + rtvm.pharmacyid_bidding = json['pharmacyId'].toString() ?? ''; + rtvm.amount_bidding = json['biddingAmount'].toString() ?? ''; + rtvm.bidding_bookingid = json['bookingId'].toString() ?? ''; + + // rtvm.prescription_url = json['pictureUrl'][0] ?? ''; + + return rtvm; + } + +} \ No newline at end of file diff --git a/lib/models/cartview_model.dart b/lib/models/cartview_model.dart new file mode 100644 index 0000000..6e36052 --- /dev/null +++ b/lib/models/cartview_model.dart @@ -0,0 +1,57 @@ +import 'dart:convert'; + +List biddingCartviewModelFromJson(String str) => List.from(json.decode(str).map((x) => BiddingCartviewModel.fromJson(x))); + +String biddingCartviewModelToJson(List data) => json.encode(List.from(data.map((x) => x.toJson()))); + +class BiddingCartviewModel { + String? id; + String? medicinename_bidding ; + int? quantity_bidding; + double? price_bidding; + List? medicine_timings; + + BiddingCartviewModel({ + this.id, + this.medicinename_bidding , + this.quantity_bidding, + this.price_bidding, + this.medicine_timings, + }); + + factory BiddingCartviewModel.fromJson(Map json) => BiddingCartviewModel( + id: json["_id"], + medicinename_bidding : json["medicinename"], + quantity_bidding: json["quantity"], + price_bidding: json["price"]?.toDouble(), + medicine_timings: json["medicine_timings"] == null ? [] : List.from(json["medicine_timings"]!.map((x) => MedicineTiming.fromJson(x))), + ); + + Map toJson() => { + "_id": id, + "medicinename": medicinename_bidding , + "quantity": quantity_bidding, + "price": price_bidding, + "medicine_timings": medicine_timings == null ? [] : List.from(medicine_timings!.map((x) => x.toJson())), + }; +} + +class MedicineTiming { + String? id; + String? medicineTimings; + + MedicineTiming({ + this.id, + this.medicineTimings, + }); + + factory MedicineTiming.fromJson(Map json) => MedicineTiming( + id: json["_id"], + medicineTimings: json["medicine_timings"], + ); + + Map toJson() => { + "_id": id, + "medicine_timings": medicineTimings, + }; +} \ No newline at end of file diff --git a/lib/models/offersview_model.dart b/lib/models/offersview_model.dart index da9bf12..ef4f81d 100644 --- a/lib/models/offersview_model.dart +++ b/lib/models/offersview_model.dart @@ -5,7 +5,7 @@ class GetOffersDetailsModel { String offer_name = ''; String offer_code = ''; String description = ''; - String discount_percentage=''; + String offer=''; String starting_date=''; Color cardColor=Colors.white; String ending_date=''; @@ -20,7 +20,7 @@ class GetOffersDetailsModel { rtvm.offer_name = json['offer_name'] ?? ''; rtvm.offer_code = json['offer_code'] ?? ''; rtvm.description = json['description'] ?? ''; - rtvm.discount_percentage = json['discount_percentage'] ?? ''; + rtvm.offer = json['offer'] ?? ''; rtvm.starting_date = json['starting_date'] ??''; rtvm.ending_date = json['ending_date'] ??''; diff --git a/lib/offers.dart b/lib/offers.dart index b3928bb..f779edf 100644 --- a/lib/offers.dart +++ b/lib/offers.dart @@ -18,7 +18,7 @@ class _offersState extends State { TextEditingController offer_nameController = TextEditingController(); TextEditingController offer_codeController = TextEditingController(); TextEditingController descriptionController = TextEditingController(); - TextEditingController discount_percentageController = TextEditingController(); + TextEditingController offerController = TextEditingController(); TextEditingController starting_dateController = TextEditingController(); TextEditingController ending_dateController = TextEditingController(); var selIOS; @@ -145,12 +145,12 @@ class _offersState extends State { padding: const EdgeInsets.all(10), child: TextFormField( cursorColor: greyColor, - controller: discount_percentageController, - keyboardType: TextInputType.number, - maxLength: 2, + controller: offerController, + keyboardType: TextInputType.text, + textCapitalization: TextCapitalization.characters, decoration: const InputDecoration( prefixIcon: Icon( - Icons.percent_outlined, + Icons.local_offer, color: primaryColor, ), border: OutlineInputBorder( @@ -161,7 +161,7 @@ class _offersState extends State { enabledBorder: OutlineInputBorder( borderSide: BorderSide(color: primaryColor), ), - labelText: 'Enter Percentage', + labelText: 'Enter Offer', labelStyle: TextStyle( color: greyColor, //<-- SEE HERE ), @@ -321,7 +321,7 @@ class _offersState extends State { if (offer_nameController.text != '' && offer_codeController.text != '' && descriptionController.text != ''&& - discount_percentageController.text != ''&& + offerController.text != ''&& starting_dateController.text != '' && ending_dateController.text != '') { AppSettings.preLoaderDialog(context); @@ -330,7 +330,7 @@ class _offersState extends State { payload["offer_name"] = offer_nameController.text.toString(); payload["offer_code"] = offer_codeController.text.toString(); payload["description"] = descriptionController.text.toString();; - payload["discount_percentage"] = discount_percentageController.text.toString(); + payload["offer"] = offerController.text.toString(); payload["starting_date"] = starting_dateController.text.toString(); payload["ending_date"] = ending_dateController.text.toString(); payload["offer_status"] ="active"; diff --git a/lib/offersdata.dart b/lib/offerstabdata.dart similarity index 88% rename from lib/offersdata.dart rename to lib/offerstabdata.dart index 021deb3..504b087 100644 --- a/lib/offersdata.dart +++ b/lib/offerstabdata.dart @@ -475,7 +475,7 @@ class _OffersDataState extends State with TickerProviderStateMixin { Text('OfferName :',style: labelTextStyle()), Text('OfferCode :',style: labelTextStyle()), Text('OfferDes :' ,style: labelTextStyle()), - Text('OfferDis(%) :' ,style: labelTextStyle()), + Text('offer :' ,style: labelTextStyle()), Text('StartDate :',style: labelTextStyle()), Text('EndDate :' ,style: labelTextStyle()), @@ -489,7 +489,7 @@ class _OffersDataState extends State with TickerProviderStateMixin { Text(activeOffersList[index].offer_name,style: valuesTextStyle()), Text(activeOffersList[index].offer_code,style: valuesTextStyle()), Text(activeOffersList[index].description,style: valuesTextStyle()), - Text(activeOffersList[index].discount_percentage,style: valuesTextStyle()), + Text(activeOffersList[index].offer,style: valuesTextStyle()), Text(activeOffersList[index].starting_date,style: valuesTextStyle()), Text(activeOffersList[index].ending_date,style: valuesTextStyle()) @@ -507,59 +507,78 @@ class _OffersDataState extends State with TickerProviderStateMixin { showUpdateOfferDialog(activeOffersList[index]); }, ),), - Expanded(child:IconButton( - icon: const Icon(Icons.hide_source_rounded,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 In_Active Offer??', - style: TextStyle( - color: primaryColor, - fontSize: 16, - )), - actionsAlignment: MainAxisAlignment.spaceBetween, - actions: [ - TextButton( - onPressed: ()async { - bool deleteOfferStatus = await AppSettings.deleteOffers(activeOffersList[index].offer_code); - if(deleteOfferStatus){ - getActiveOffersViewData(); - AppSettings.longSuccessToast('Offer In_Active Successfully!!'); - getInactiveOffersViewData(); - Navigator.of(context).pop(true); - } - else{ - AppSettings.longFailedToast('Offer In_Active failed'); - } - }, - child: const Text('Yes', - style: TextStyle( - color: primaryColor, - fontSize: 18, - )), - ), - TextButton( - onPressed: () { - Navigator.of(context).pop(true); - }, - child: const Text('No', - style: TextStyle( - color: primaryColor, - fontSize: 18, - )), - ), - ], + Expanded( + child: Row( + children: [ + Text(''), + Switch( + value: false, // Replace this with your actual property + onChanged: (newValue) async { + if (newValue) { + // Show your AlertDialog for confirmation + showDialog( + context: context, + builder: (BuildContext context) => AlertDialog( + title: Text( + 'Do you want to In_Activate the offer?', + style: TextStyle( + color: primaryColor, + fontSize: 16, + ), + ), + actionsAlignment: MainAxisAlignment.spaceBetween, + actions: [ + TextButton( + onPressed: () async { + bool deleteOfferStatus = + await AppSettings.deleteOffers( + activeOffersList[index].offer_code); + if (deleteOfferStatus) { + getActiveOffersViewData(); + AppSettings.longSuccessToast( + 'Offer In_Active Successfully!!'); + getInactiveOffersViewData(); + // Update the isActive property + + } else { + AppSettings.longFailedToast('Offer In_Active failed'); + } + Navigator.of(context).pop(true); + }, + child: const Text( + 'Yes', + style: TextStyle( + color: primaryColor, + fontSize: 18, + ), + ), + ), + TextButton( + onPressed: () { + Navigator.of(context).pop(true); + }, + child: const Text( + 'No', + style: TextStyle( + color: primaryColor, + fontSize: 18, + ), + ), + ), + ], + ), + ); + } else { + // Handle the case where the user wants to undo the In_Activation + // Update the isActive property + //m;./ activeOffersList[index].isActive = false; + // You might want to add code to revert the In_Activation in your data model here + } + }, ), - ); - - - - }, - ),) + ], + ), + ), ], @@ -691,7 +710,7 @@ class _OffersDataState extends State with TickerProviderStateMixin { Text(inactiveOffersList[index].offer_name,style: valuesTextStyle()), Text(inactiveOffersList[index].offer_code,style: valuesTextStyle()), Text(inactiveOffersList[index].description,style: valuesTextStyle()), - Text(inactiveOffersList[index].discount_percentage,style: valuesTextStyle()), + Text(inactiveOffersList[index].offer,style: valuesTextStyle()), Text(inactiveOffersList[index].starting_date,style: valuesTextStyle()), Text(inactiveOffersList[index].ending_date,style: valuesTextStyle()) diff --git a/lib/offersview.dart b/lib/offersview.dart index f966b85..9e0eef4 100644 --- a/lib/offersview.dart +++ b/lib/offersview.dart @@ -454,7 +454,7 @@ class _OffersViewState extends State with TickerProviderStateMixin { Text(offersviewList[index].offer_name,style: valuesTextStyle()), Text(offersviewList[index].offer_code,style: valuesTextStyle()), Text(offersviewList[index].description,style: valuesTextStyle()), - Text(offersviewList[index].discount_percentage,style: valuesTextStyle()), + Text(offersviewList[index].offer,style: valuesTextStyle()), Text(offersviewList[index].starting_date,style: valuesTextStyle()), Text(offersviewList[index].ending_date,style: valuesTextStyle()) diff --git a/lib/settings.dart b/lib/settings.dart index 7dff2f8..c83f7e8 100644 --- a/lib/settings.dart +++ b/lib/settings.dart @@ -1,3 +1,5 @@ + +import 'dart:convert'; import 'dart:io'; import 'dart:typed_data'; import 'package:flutter/material.dart'; @@ -144,6 +146,7 @@ class AppSettings { static double userLatitude = 0; static double userLongitude = 0; static String healthpharmaIdsign = ''; + static String healthpharmastaticid = '123456789'; static String profileImage = ''; static List storedPreferenceValidKeys = ['pharmacyname', 'access_token']; static String preloadText = 'Please wait'; @@ -179,6 +182,15 @@ class AppSettings { static String deleteOffersDataUrl = host + 'deleteOffer'; static String reactiveOffersDataUrl = host + 'reactiveOffer'; static String medecineDataUrl = host + 'medicine'; + static String getAllBiddingDataUrl = host + 'getBiddingRequests'; + static String getRequestBiddingDataUrl = host + 'biddingRequest'; + static String addToCartDataUrl = host + 'cart/add'; + static String getCartDataUrl = host + 'cart/total-price'; + + + + + @@ -440,6 +452,181 @@ class AppSettings { return ''; } } + + + static Future getCartDetails(bookingId) async { + //path parameter + var uri = Uri.parse(getCartDataUrl + '/' + bookingId); + var response = await http.get(uri, headers: await buildRequestHeaders()); + var responcedatatemp=jsonDecode(response.body); + print("responcedata$responcedatatemp"); + print("responcedata$bookingId"); + 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 addToCart(String orderId, String quantity, String price,String mName,String mtimings) async { + var headers = { + 'Content-Type': 'application/json' + }; + var body=json.encode({ + "bookingId": orderId, + "items": [ + { + "medicinename": mName, + "quantity": quantity, + "price": price, + "medicine_timings":[ + { + "medicine_timings":mtimings + } + ] + } + ] + }); + print("Timintgs"+body.toString()); + var uri = Uri.parse(addToCartDataUrl); + var response = await http.post( + uri, + headers: headers, + body: body, + ); + + return response; + } + +/* static Future addToCart(payload) async { + var response = await http.post(Uri.parse(addToCartDataUrl), + body: json.encode(payload), + headers: {'Content-type': 'application/json'}); + + if (response.statusCode == 200) { + try { + var _response = jsonDecode(response.body); + print("responcedata$_response"); + return true; + *//* if (_response['items']['error'] == false) { + return true; + } else { + return false; + }*//* + } catch (e) { + // display error toast + return false; + } + } else { + return false; + } + }*/ + + + static Future getAllBiddingRecords() async { + //path parameter + var uri = Uri.parse(getAllBiddingDataUrl + '/' + healthpharmaIdsign); + 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 ''; + } + } + + //getRequestBiddingDataUrl + + + /*static Future getRequestBiddingDetails( bookingId) async { + var uri = Uri.parse(getRequestBiddingDataUrl + '/' +bookingId ); + try { + var response = await http.put(uri, headers: await buildRequestHeaders()); + var responcedatatemp=jsonDecode(response.body); + print("responcedata$responcedatatemp"); + print("responcedata$bookingId"); + 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 buildRequestHeaders()); + if (response.statusCode == 200) { + return true; + } else { + return false; + } + } else { + return false; + } + } else { + return false; + } + } catch (e) { + print(e); + return false; + } + }*/ + + static Future getRequestBiddingDetails(var bookingId,payload) async { + var response = await http.put(Uri.parse(getRequestBiddingDataUrl + '/' + bookingId), + body: json.encode(payload), headers: await buildRequestHeaders()); + if (response.statusCode == 200) { + try { + var _response = json.decode(response.body); + print(_response); + return true; + } catch (e) { + // display error toast + return false; + } + } else if (response.statusCode == 401) { + bool status = await AppSettings.resetToken(); + if (status) { + response = await http.put(Uri.parse(getRequestBiddingDataUrl + '/' + bookingId), + body: json.encode(payload), headers: await buildRequestHeaders()); + if (response.statusCode == 200) { + return true; + } else { + return false; + } + } else { + return false; + } + } else { + return false; + } + } + + + + + + + static Future getinactiveOffers() async { //path parameter var uri = Uri.parse(getOffersinActiveDataUrl + '/' + healthpharmaIdsign); @@ -650,6 +837,8 @@ class AppSettings { + + static Future updateProfilePicture(payload) async { var uri = Uri.parse(profilePicUrl + '/' + pharmacyId); var response = await http.post(uri, diff --git a/lib/signup.dart b/lib/signup.dart index f283c7f..f92913b 100644 --- a/lib/signup.dart +++ b/lib/signup.dart @@ -168,12 +168,12 @@ class _SignUpState extends State { image: const AssetImage('images/logo.png'), height: MediaQuery.of(context).size.height * .18, )), - SizedBox( - height: 05, + height: 10, ), Container( - padding: const EdgeInsets.all(10), + padding: const EdgeInsets.all(10), // Set the desired width + child: TextFormField( cursorColor: greyColor, controller: nameController, @@ -181,9 +181,7 @@ class _SignUpState extends State { decoration: textFormFieldDecoration(Icons.person,'Name'), ), ), //name - SizedBox( - height: 05, - ), + Container( padding: const EdgeInsets.all(10), child: TextFormField( @@ -194,9 +192,7 @@ class _SignUpState extends State { ), ), - const SizedBox( - height: 5, - ), + Container( padding: const EdgeInsets.all(10), child: TextFormField( @@ -209,9 +205,7 @@ class _SignUpState extends State { ), ), //mobile - const SizedBox( - height: 5, - ), + Container( padding: const EdgeInsets.all(10), child: TextFormField( @@ -222,9 +216,7 @@ class _SignUpState extends State { ), ), - const SizedBox( - height: 5, - ), + GestureDetector( child: Container( padding: const EdgeInsets.all(10), diff --git a/lib/updateprofile.dart b/lib/updateprofile.dart index 9fc0aab..2b06eb0 100644 --- a/lib/updateprofile.dart +++ b/lib/updateprofile.dart @@ -117,7 +117,7 @@ class _UpdateprofileState extends State { height: MediaQuery.of(context).size.height * .15, decoration: BoxDecoration( shape: BoxShape.rectangle, - border: Border.all(width: 5, color: Colors.blueGrey), + border: Border.all(width: 2, color: Colors.blueGrey), image: DecorationImage( image: (AppSettings.profilePictureUrl != ''&& AppSettings.profilePictureUrl != 'null') ? NetworkImage(AppSettings.profilePictureUrl) as ImageProvider : AssetImage("images/mobilebg.png"), // picked file fit: BoxFit.fitWidth)), @@ -301,22 +301,28 @@ class _UpdateprofileState extends State { payload["emails"] = [{"email":emailController.text.toString()}]; payload["description"] = descriptionController.text.toString(); bool signUpStatus = await AppSettings.updatePharmaData(payload); - try{ + AppSettings.longSuccessToast("Pharmacy Profile Updated !!"); + Navigator.push( + context, + MaterialPageRoute(builder: (context) => Dashboard()), + ); + /* try{ if (signUpStatus) { Navigator.pop(context); + AppSettings.longSuccessToast("Pharmacy Profile Updated !!"); Navigator.push( context, MaterialPageRoute(builder: (context) => Dashboard()), ); - AppSettings.longSuccessToast("Pharmacy Profile Updated !!"); + } else { - AppSettings.longFailedToast("Pharmacy Profile Not Updated !!"); + //AppSettings.longFailedToast("Pharmacy Profile Not Updated !!"); } } catch(exception){ print(exception); AppSettings.longFailedToast("Please enter valid details"); - } + }*/ }, child: Text('Update'), ) diff --git a/pubspec.lock b/pubspec.lock index 7dea8d6..be82167 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -868,6 +868,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "6.0.5" + quantity_input: + dependency: "direct dev" + description: + name: quantity_input + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.2" sanitize_html: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index dc640df..b7da571 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -62,7 +62,7 @@ dev_dependencies: cloudinary_public: ^0.21.0 carousel_slider: ^4.2.1 photo_view: ^0.14.0 - + quantity_input: ^1.0.2 flutter_icons: