From 44ccc525fb95e06db4798dc9cd9754430f5d0425 Mon Sep 17 00:00:00 2001 From: Sneha Date: Tue, 30 Sep 2025 14:28:38 +0530 Subject: [PATCH] financial screens added --- images/advance.png | Bin 0 -> 2511 bytes images/capacity.png | Bin 0 -> 1524 bytes images/cross.png | Bin 0 -> 709 bytes images/edit.png | Bin 0 -> 865 bytes images/plus.png | Bin 0 -> 465 bytes images/price.png | Bin 0 -> 2194 bytes images/quantity.png | Bin 0 -> 1497 bytes images/rite.png | Bin 0 -> 349 bytes images/send.png | Bin 0 -> 817 bytes images/time.png | Bin 0 -> 2094 bytes images/water.png | Bin 0 -> 912 bytes lib/common/dashboard.dart | 177 +++++-- lib/common/settings.dart | 40 ++ .../add_transaction_for_credit_account.dart | 216 ++++++++ lib/financials/add_transactions.dart | 151 ++++++ .../building_transactions_details.dart | 296 +++++++++++ lib/financials/create_credit_accounts.dart | 143 ++++++ lib/financials/financial_main_screen.dart | 422 +++++++++++++-- lib/orders/accept_order_requests.dart | 412 +++++++++++---- lib/orders/all_orders.dart | 12 +- lib/orders/edit_order_requests.dart | 267 +++++++--- lib/orders/order_requests.dart | 8 +- lib/orders/order_requests_model.dart | 6 +- lib/orders/search_order_appbar.dart | 52 +- lib/plans/all_plans.dart | 10 +- lib/plans/search_plan_appbar.dart | 44 +- lib/set_rates/set_rates.dart | 480 +++++++++++++----- pubspec.lock | 8 + pubspec.yaml | 1 + 29 files changed, 2293 insertions(+), 452 deletions(-) create mode 100644 images/advance.png create mode 100644 images/capacity.png create mode 100644 images/cross.png create mode 100644 images/edit.png create mode 100644 images/plus.png create mode 100644 images/price.png create mode 100644 images/quantity.png create mode 100644 images/rite.png create mode 100644 images/send.png create mode 100644 images/time.png create mode 100644 images/water.png create mode 100644 lib/financials/add_transaction_for_credit_account.dart create mode 100644 lib/financials/add_transactions.dart create mode 100644 lib/financials/building_transactions_details.dart create mode 100644 lib/financials/create_credit_accounts.dart diff --git a/images/advance.png b/images/advance.png new file mode 100644 index 0000000000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<2>K73!E0m}Z z(uSRoJCQeOk{qvAt6dkFWiExNO$gE!izc&e7wt#W^q8!~oC+q;Uz*ZOx?a9~c~@2n Z{yznWnlUHe0gnIx002ovPDHLkV1kIhhy4Hm literal 0 HcmV?d00001 diff --git a/images/capacity.png b/images/capacity.png new file mode 100644 index 0000000000000000000000000000000000000000..a4e1256565080a3608a9355b530781fbc00e2773 GIT binary patch literal 1524 zcmVK3J00009a7bBm001mY z001mY0i`{bsQ>@~0drDELIAGL9O(c600d`2O+f$vv5yPTkkFjUYc?CPP1jkwM_4?07qcH@F zoK%dB2#(Xmf17cibASZ|K?gI8F(UV~L{l8@1XiXvT^dI3vpVT6}^|IB(VK^>@$+ z0}C+EYb!Kca>w~fe>i&fW(FF)VeGF>A{2{vINf_8AvVx8&vmP4AHIpV(X$GSy@O_~8PJc9kMe50 z?x6q`9L?NyoLArX=ZD-|aNXYh{rv*2T(Lr?*MvOB!p+TQ4}tIU+=f?pEVQg+pSvo3 zRuV(zInv$%A6~_WYq#t=AR(~dBkXrMd|l?rvXqCFCbL=B^}NqG7n;5VzpM>8#dY1L zC zjpq#^r#PI?aVbu2LoHXzFw#OB^;j z=fG|;ND_h&#ZX!q$mlp|bf(kk8{{1P;ohjPDnX^AcCGlzv~jE5gq(si;(=zeYWt(N z@PXnId$w0RIbiUAtD_RUsK;}AA}2KF(0 zZ6gB4PaE}mQ*5uawAO32|J%`fNYjs0*By{Gg{;rwcr%M}Nr>Z(ye2q>{t|CciBzjX zj?V}~cyIv6+$%#IZ`5XBTvEINSBpMqfRae$_;~B}Cpm56_E|;sM z0_{e1rx^2)MB2p^e#hxQ+(xFFkp9pMOCkwuUFT+MJ3~n%D`HT<*k!Dx5>rTnoF;mf ziJ+2o|A8DJj4KRqP~|N5kqFq?o=HdVWX{xhHf!Uw>?(*t+4)Yx_lIDZlY5riYR0t$RX^FH}YwG66qN(6=A#)F(eu5GF&L)*z#gP-^B}Y0bA4LLJZ7> zM$Ue2HezaLNA>mta=>=eb+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(fA}lHQ7dr zk={ggF&K?bR?6IhrGU~t>)yaA(owECKput%*cl8@iLh}#cU&`6&`guo#f8BM$Swc6YF_U zA^S*Wbqq(}%~xx^yt3)O2r0%4yK7r{C1OQMNi4u~TY2eXMN09%6R-?Jrc|*)rQ$f$ zsLt~0DQ)s7T&h-|*!~zZ1k@`zRzDnos->h2C>R%{q#Y;_SEQsZCAm5}Ur%eGqN=aV#9rRU7a?3m5vy|j# zEA(B8xg&Nu9DYE+IQIk(q!?UJB&gMY46Y>8G`;oP8swQ2 z^RLH(pp_Ton-r6YY0H~I$ph%hHz_6)BgD`aK!gcwz%?mmW%5wgJr#(Qz&*Gq#bja% z@ue*QDPPQ0DQ2a|C~p_c)K=)S6ceoc4s8K*^NB~J7AzJm4bUXip;quTP3eu1%HI-H zp%k+!W=)d!H1Qj3P|Lk8yzmjp+6K8)EXBxBlpZMx2c($gHI}AZ?K0blBT|eEMOmEp zdnPCS00000NkvXXu0mjfwU2*f literal 0 HcmV?d00001 diff --git a/images/plus.png b/images/plus.png new file mode 100644 index 0000000000000000000000000000000000000000..c5f716c176432899faef110915951fd9d594aa27 GIT binary patch literal 465 zcmeAS@N?(olHy`uVBq!ia0vp^0U*r51|<6gKdl8)oCO|{#S9EO-XP4l)OOlRpde#$ zkh>GZx^prwfgF}}M_)$E)e-c@Na%r9}jv*C{Z|_{pJ!Bx__Hee}0gjhyvZ~4( z7*kvNE_j|`OKnbT-gNNo)&=~oN(uiPdMxLQd=yYztlZI5BWesZk%3{Jcly+#@2-3H z9NpNR{AyR8QHzf+=byjCmGZves8j8pn&|3FEJw0) ze!VTa7xGE?-CE!J#VV0rOnPf#Bk%89qVgbO(}m_4I>BWJ4x1+BzKy(J%5>)YcEjlU zn#J7P4bL3w_@S<(w4kFwiK&Z2g8*ZZ6my^P^KD@>rI_o^&G~IGM_ju2y?b>3OGXjb v!}i<5J}3KE-9GI@)zvj@VRqLzbWhfpS`^IYCwEXS3j3^P61^@s6JKvMJ00009a7bBm001mY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N}U0Y|6kKeA?Z3qPm*PzqKilRTPiA78A}q7!EJ2t*y7yD)c;a<{XIv(`?Q= zqo6LNsWu6o^85DfTWLJqmn3X(Mu2_pei5fr}pKj6-^ Unj{_n{Qv*}07*qoM6N<$f_vN+qW}N^ literal 0 HcmV?d00001 diff --git a/images/quantity.png b/images/quantity.png new file mode 100644 index 0000000000000000000000000000000000000000..01edaa6dba9178c1992fcf017ce32d69a9a687ea GIT binary patch literal 1497 zcmV;~1t$85P)1^@s6JKvMJ00009a7bBm001mY z001mY0i`{bsQ>@~0drDELIAGL9O(c600d`2O+f$vv5yP8mr76YgNPN%^Spwa%YDFqYp@5PaP43+Y1QlX5oC;3C={vaxURPg zBPR(o${fc2DrG#nltR%+LXn31Cei|9e=@nqa%6E;p_9w)-AGy?k0#?2WJpA)ZnxWH zWU%+2BJ~9_!d)$3oWIl7ma^r#Zu|7~bbN7fF@~SWa5&7ryu1{I5Dj4LR#j)#mo{WT z#76b{eW|Ha=Z2F-}fS z3XlQIHcAMk0hj2|!S17U2ZW|iN#SrHpuPC2EXODUGGIw4N6Lb-66c>`_tDuQJEFFU z70M7Rlp$6qLtHp?IDhMPyU}vSM&SD+)4=)Qg+h2lswUd-hv5_v)&;-*rmbmG3p zPCX2saddgT!QeKok`-!>ly`ArS)mq*5z7j-ibkx%U-bYw7zaMD7UC~TZ>1(=n~4RL zQmHjBI(VU^5Fe}6YJ0W(@$s<`2;rHEb+l9O^73-za9(HRPw7~ghDU9ql8ANm#@tja zyXt|NSXQVR>%_7`Ef6P`6>0^YSXL+nB$kl!VX@2#Wr!8Z5G#}+RwzTPP=;8c3^5W4 zm&!MAd7LeUmJOpQLP zDh5)1qHWc1JS>@;$R5szUhj@;HjmDroo!>Bj$@|ZleBek!KrC>Gk0Q>a=PymqOrJz zJR%g18rq{x8^?~`fG-kp55nmO&;rX6NYk}C)Ro%g$iAvsTfBQNjVmmt+3dg>7bJq zu9QR7HR>p~NqKH>%>y4-%H>FGYn(lx$~HNgb1|!g_Dg~40c@VQBg1V#UH^nPi2#(JH9k*l*mh!T z8BPj~U`rU^Yq~OA+>(C?zC?P}aj$I=Vv- z48e-`>buE?QLYO89aS+d2C0R@4|g=>?_mv;GUA$J!A#0Xn~a6>eSex>QLrvog?`Hi zooj(B)B~ghJJi-(D)#Z7y3d8LE6C+M&E;_r1f9seAOUf?Dta*k8pl@PI8XHIkI+uw z6mX~YYpTzLu0^TzJ8VF&-~R#{qyD{3L2yr55f7bTSBQ5w<*s$FE5PzLw&^NT4hhIQ zSB3t{6~&XV0qer5gp6Isxls9FiB`Q#b5$4=gS>&q7fd6`S zb_E&XzrNCUrC$^X>{DEXk;;$4Aoeb;SQMTAa&}hF@&yw#(*4OKOb0;jCB7srqa#bKX02 zs4+W2qk!9NI>*8TY+?(Lu!3=p+$S9|-_J=#=Y*=`CC*IC*jUs1dBOElOxql~znaf( z-)k;b=)WbV(D7+w|0$<;jnlOAA6ITrjk5VuwdR7}hNFqQ7R4rZJC{1{J|fm`E&5g} zTIQ3;7lDYk@m~TW-fC2Ntl1`RYZ8|2>YT9E%>+oWnec^KclenUSzqiF$Z}D4TGiy& fa)Zli;$pkv&mN*u*ErSyeb3gTe~DWM4f5-5I? literal 0 HcmV?d00001 diff --git a/images/send.png b/images/send.png new file mode 100644 index 0000000000000000000000000000000000000000..e7379c1ea937cdf72720bbf8cecdef6a56246fb0 GIT binary patch literal 817 zcmV-11J3-3P)@~0drDELIAGL9O(c600d`2O+f$vv5yP(*1K~#7F?VF2j z+b|SG=}wRlJVHm%2;HC_p&KL{G#j`hbOUvRb_0&!Zg4_E79d+9`6Tlz=Kw@vSmNh_ z_v+fRl=|d`!}t&IV*Z>=JDT>-wBLur;lFxDOfkNicHtKL`fS=!JsW1x8b7u$oq7iB z4nR(C+DYvhM?rL;FnZU8VeTKDU9hk)KiQklm<7GxE%bfzo-NKF!kl+gnCqgaTo#V8 z()uMROwS$+m<8E5jyqm=lnxZezJF4!f=4!xpu)JpJ^}XA(V~h zd|OnB&zxz&XV@ScM?a$hUjl{cso7_EKsJv4Y+=McqiVxU>V*eoKIlDE7vv0jR45x4}*LkG0>)cR~aE3^klmqnOSY2$Zo@J!1{|SOUa*G=*{C3Hl|IxgUlc286?wt=5&^J zaJ%PtpW{*bm1lZi~peH%h*l-3`PDm4_43oC;ZG5tX>x%){alM5+>RHO-J zkqbG3RHTU}l?yq8R18QY7jg%w7!dy_Rpo+I42UEbY6wy>U@n(#<@t34sTeSqi(Ywd zA1Fe;AQb~v%7vPPR16Txh1!Eu3=qhLR)SOv@W_SMf>aDxkP9sasTi>Q5MrA_Dh8~3 vOtpP~kic-)>a!3d43D~N=CWxgNJZiU-kK62NrxT200000NkvXXu0mjf$WvVR literal 0 HcmV?d00001 diff --git a/images/time.png b/images/time.png new file mode 100644 index 0000000000000000000000000000000000000000..d28b5a6d8e55087d5aa24421ede9043e2fc1aaf3 GIT binary patch literal 2094 zcmV+}2+{Y6P)@~0drDELIAGL9O(c600d`2O+f$vv5yPgML= z81>32PF{xmy3nHDth2MD_apQ@rbrG7*(#so@R$jS_Hq*lb=xfw<}Sj~#$hE5d}hp4{KRPh-HQCQ8{v)oK?K z6gHAL3;@oGCTJch2pdesHy>=P8(kiVum&Fcy$2@u#%{x-Ax}Gjv)uoXW@J&>WvVWhp%6MgdBiN@e|JXfgO;r z8zvHk$B`qnd9K(2Ql6m{bsz`a+}@t!7dn}4LodPEo1ErP)LT-vxfKz+^hkN*)_xu{ z@#nlqA|Oe}^KDL?6r==wSCW2qfDl*84P-zpQI6|&xE+rCLioWakS}VMZJD7}gvWH( zIDN$uMIHdhao(BwXm>*;`4%=5WIu_>dpZv(k8p{$=9_tmLN^K5g;Ms`_I$REAX9+M z7_MImu^?4OqDY!pqY{-XZM(4HP)a*IdoF z2Ma{SNfVvjR(UMR8?*%Jo=knj!L+VgAWFn2@UjoMWkBDPXY8D^xn_t`b`ui_;F#YA zpz`Kyt5#%J%@Bp20i%CuTcs(2zBi*vaViyME6xyw>+&yVE)TXG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|qOuh<^ZsJ7e3n4*9$RzHi`H9X~EG=7Q%fEz5G@PT2Fg zf%h~(2;)OTCgWPBxePo1E=EanviW=)MK$qjGwM76;NYLJFT|Twua6;Z9g|5j%UDkc zQD%(kp&Ep6@z_#u{?=$TM!Vl{YShjkylE#&*cry&di{j6%z-PB25F4F;=>wA#%&76 z`9Ktd<_HcX$QbrcdU$3n=ui|t* zf8?GwOsi0m1EYe)&V~q~QL}5)$uzC0Wirn(E9l~)`3no+1YJkRhx(!#6fE{HXxNW1 z!*+``oM{+G8vdXL+2wT9vC|N0?txJgyb(kg^&vLs3bLKD?aj*gG2&DY&-;mE`t^{G zHph0o_WiFJ#@b?Qo(lPZQi~(cKiA3jk>_*Y@0LoXaivl@*^a!=W~~fB?^wg(jKZ0b z%jXv{g(ks81G=VZj#MW~!+g%|8)%S~dMOr*{V;=$!AaAH?d;revPPvXR8|mQNvm3| zI!VT%&>;?PLpsRWKd9Ae!z6?DXIJRc<>RfKyKP_ig)5vFpT4>UVrK%-Z-m!;fMmGAt2Vr}Q2WH%a7x3l z)M9-tve5{}TDaCdoGV<=Fve*av?KA(d^VevIp;bGl7`8a>SVK7C+Qk=4U5G>U#(W< zod*24nx;90LcvMX9D*PSg7`n7%$zdw5FM16D|Aq1uGB!8xeCh6DKn?ce19xu<_ah? zS3#M13@9^KU6e9&%FJU!nK?la1VMauC^M(bJVXa&<_aB@nJYC=X0C!VbIQyqGv6Oe mnYjYW%vDfk9)r)6ng0cMB { ), ); final GlobalKey _scaffoldKey = GlobalKey(); + final TextEditingController orderSearchController = TextEditingController(); + final TextEditingController planSearchController = TextEditingController(); + // Define a list of widgets for each screen final List _screens = [ HomeScreen(), - AllOrders(), - AllPlans(), + AllOrders(navigationFrom: 'bottombar',), + AllPlans(navigationFrom: 'bottombar',), FleetStep1Page(), FinancialMainScreen(), ]; @@ -246,6 +251,126 @@ class _DashboardScreenState extends State { }); } + final List _screenTitles = [ + 'Aquick Supplier', // index 0 + 'Orders', // index 1 + 'Plans', // index 2 + 'Resources', // index 3 + 'Financials', // index 4 + ]; + + String getScreenTitle(int index) { + if (index < 0 || index >= _screenTitles.length) return ''; + return _screenTitles[index]; + } + + PreferredSizeWidget? _buildAppBar() { + // 👉 Orders tab (index 1): Custom Search AppBar + if (_currentIndex == 1) { + return SearchOrderAppBar( + controller: orderSearchController, + onBack: () { + setState(() { + _currentIndex = 0; // go back to Home + }); + }, + onHelp: () { + // handle help button action + debugPrint("Help tapped"); + }, + ); + } + + if (_currentIndex == 2) { + return SearchPlanAppBar( + controller: planSearchController, + onBack: () { + setState(() { + _currentIndex = 0; // go back to Home + }); + }, + onHelp: () { + // handle help button action + debugPrint("Help tapped"); + }, + ); + } + + // 👉 Home tab (index 0): Main AppBar + if (_currentIndex == 0) { + return AppBar( + backgroundColor: Colors.white, + elevation: 0, + scrolledUnderElevation: 0, + titleSpacing: 0, + title: Text( + 'Aquick Supplier', + style: fontTextStyle( + 16, const Color(0XFF515253), FontWeight.w600), + ), + iconTheme: const IconThemeData(color: Color(0XFF2A2A2A)), + actions: [ + Row( + children: [ + Padding( + padding: const EdgeInsets.fromLTRB(10, 10, 0, 10), + child: IconButton( + icon: Image.asset('images/calendar_appbar.png'), + onPressed: () {}, + ), + ), + Padding( + padding: const EdgeInsets.fromLTRB(0, 10, 10, 10), + child: IconButton( + icon: Image.asset('images/notification_appbar.png'), + onPressed: () {}, + ), + ), + ], + ) + ], + leading: IconButton( + icon: Image.asset( + 'images/profile_appbar.png', + height: 20, + width: 20, + ), + onPressed: () { + _scaffoldKey.currentState?.openDrawer(); + }, + ), + ); + } + + // 👉 Other tabs (index 2,3,4): Simple AppBar with Back to Home + return AppBar( + backgroundColor: Colors.white, + elevation: 0, + scrolledUnderElevation: 0, + titleSpacing: 0, + title: Text( + getScreenTitle(_currentIndex), + style: fontTextStyle( + 16, const Color(0XFF515253), FontWeight.w600), + ), + leading: GestureDetector( + onTap:(){ + setState(() { + _currentIndex = 0; // Back → Home + }); + }, // 👉 use callback from parent + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Image.asset( + 'images/backbutton_appbar.png', + height: 24, + width: 24, + fit: BoxFit.contain, + ), + ), + ), + ); + } @override Widget build(BuildContext context) { @@ -352,52 +477,8 @@ class _DashboardScreenState extends State { child: Scaffold( key: _scaffoldKey, backgroundColor: Colors.white, - appBar: _currentIndex==0?AppBar( - backgroundColor: Colors.white, - elevation: 0, - scrolledUnderElevation: 0, - titleSpacing: 0, - title: Text('Aquick Supplier',style: fontTextStyle(16,Color(0XFF515253),FontWeight.w600),), - iconTheme: IconThemeData(color: Color(0XFF2A2A2A)), - actions: [ - Row( - children: [ - Padding(padding: EdgeInsets.fromLTRB(10,10,0,10), - child: IconButton( - icon: Image( - image: AssetImage('images/calendar_appbar.png') + appBar: _buildAppBar(), - ), - onPressed: (){ - - }, - ), - ), - - Padding(padding: EdgeInsets.fromLTRB(0,10,10,10), - child: IconButton( - icon: Image.asset( - 'images/notification_appbar.png', // Example URL image - ), - onPressed: (){ - - }, - ), - ) - ], - ) - ], - leading: IconButton( - icon: Image( - image: AssetImage('images/profile_appbar.png'), - height: 20, - width: 20, - ), - onPressed: (){ - _scaffoldKey.currentState?.openDrawer(); - }, - ), - ):null, drawer: Drawer( width: MediaQuery.of(context).size.width, backgroundColor: Colors.white, @@ -730,7 +811,7 @@ class _HomeScreenState extends State { Navigator.push( context, MaterialPageRoute( - builder: (context) => AllOrders()), + builder: (context) => AllOrders(navigationFrom: 'dashboard',)), ); }, ), diff --git a/lib/common/settings.dart b/lib/common/settings.dart index e501051..b46aa58 100644 --- a/lib/common/settings.dart +++ b/lib/common/settings.dart @@ -574,6 +574,22 @@ class AppSettings{ style: fontTextStyle(16, Color(0XFF2A2A2A), FontWeight.w600), ), iconTheme: IconThemeData(color: Color(0XFF2A2A2A)), + leading: GestureDetector( + onTap: () { + Navigator.pop(context); + }, + child: Padding( + padding: + const EdgeInsets.fromLTRB(8, 8, 8, 8), // Add padding if needed + child: Image.asset( + 'images/backbutton_appbar.png', // Replace with your image path + fit: BoxFit.contain, + color: Color(0XFF2A2A2A), + height: 24, + width: 24, + ), + ), + ), actions: [ Row( children: [ @@ -591,6 +607,21 @@ class AppSettings{ ], ) ], + + ); + } + + static supplierAppBarWithActionsText(String title,context) { + title = title ?? ''; + return AppBar( + backgroundColor: Colors.white, + elevation: 0, + scrolledUnderElevation: 0, + title: Text( + title, + style: fontTextStyle(16, Color(0XFF2A2A2A), FontWeight.w600), + ), + iconTheme: IconThemeData(color: Color(0XFF2A2A2A)), leading: GestureDetector( onTap: () { Navigator.pop(context); @@ -607,6 +638,15 @@ class AppSettings{ ), ), ), + actions: [ + Padding(padding: EdgeInsets.all(8), + child: TextButton( + onPressed: () async { + }, + child: Text('HELP', + style: fontTextStyle(14,primaryColor,FontWeight.w600),), + ),) + ], ); } diff --git a/lib/financials/add_transaction_for_credit_account.dart b/lib/financials/add_transaction_for_credit_account.dart new file mode 100644 index 0000000..50b6e6d --- /dev/null +++ b/lib/financials/add_transaction_for_credit_account.dart @@ -0,0 +1,216 @@ +import 'package:flutter/material.dart'; +import 'package:intl/intl.dart'; + +class AddCreditTransactionPage extends StatefulWidget { + const AddCreditTransactionPage({super.key}); + + @override + State createState() => + _AddCreditTransactionPageState(); +} + +class _AddCreditTransactionPageState extends State { + final _formKey = GlobalKey(); + + String? _transactionType; + String? _creditAccount; + String? _paymentMode; + String? _paymentStatus; + DateTime? _selectedDate; + + final TextEditingController _amountController = + TextEditingController(text: "₹500"); + final TextEditingController _transactionIdController = + TextEditingController(text: "₹500"); + final TextEditingController _detailsController = TextEditingController(); + + Future _pickDate() async { + DateTime now = DateTime.now(); + final picked = await showDatePicker( + context: context, + initialDate: now, + firstDate: DateTime(2020), + lastDate: DateTime(2100), + ); + if (picked != null) { + setState(() { + _selectedDate = picked; + }); + } + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + elevation: 0, + backgroundColor: Colors.white, + leading: IconButton( + icon: const Icon(Icons.arrow_back, color: Colors.black), + onPressed: () => Navigator.pop(context), + ), + title: const Text( + "Add Credit Transaction", + style: TextStyle(color: Colors.black, fontWeight: FontWeight.w600), + ), + actions: [ + TextButton( + onPressed: () {}, + child: const Text( + "HELP", + style: TextStyle(color: Colors.blue), + ), + ), + ], + ), + body: SafeArea( + child: SingleChildScrollView( + padding: const EdgeInsets.all(16), + child: Form( + key: _formKey, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + _buildDropdown( + label: "Transaction Type *", + value: _transactionType, + items: ["Credit", "Debit"], + onChanged: (val) => setState(() => _transactionType = val), + ), + const SizedBox(height: 12), + _buildDropdown( + label: "Credit Account Name *", + value: _creditAccount, + items: ["Credit Account", "Other Account"], + onChanged: (val) => setState(() => _creditAccount = val), + ), + const SizedBox(height: 12), + _buildTextField( + controller: _amountController, + label: "Amount (in ₹) *", + keyboardType: TextInputType.number, + ), + const SizedBox(height: 12), + Row( + children: [ + Expanded( + child: _buildDropdown( + label: "Payment Mode *", + value: _paymentMode, + items: ["Cash", "UPI", "Bank Transfer"], + onChanged: (val) => setState(() => _paymentMode = val), + ), + ), + const SizedBox(width: 12), + Expanded( + child: GestureDetector( + onTap: _pickDate, + child: AbsorbPointer( + child: TextFormField( + decoration: InputDecoration( + labelText: "Date *", + hintText: "DD-MM-YYYY", + suffixIcon: const Icon(Icons.calendar_today), + border: OutlineInputBorder( + borderRadius: BorderRadius.circular(8), + ), + ), + controller: TextEditingController( + text: _selectedDate == null + ? "" + : DateFormat("dd-MM-yyyy") + .format(_selectedDate!), + ), + ), + ), + ), + ), + ], + ), + const SizedBox(height: 12), + _buildTextField( + controller: _transactionIdController, + label: "Transaction ID *", + ), + const SizedBox(height: 12), + _buildDropdown( + label: "Payment Status *", + value: _paymentStatus, + items: ["Pending", "Completed", "Failed"], + onChanged: (val) => setState(() => _paymentStatus = val), + ), + const SizedBox(height: 12), + _buildTextField( + controller: _detailsController, + label: "Additional Details", + ), + const SizedBox(height: 24), + ElevatedButton( + onPressed: () { + if (_formKey.currentState!.validate()) { + // Handle save + ScaffoldMessenger.of(context).showSnackBar( + const SnackBar(content: Text("Transaction Saved")), + ); + } + }, + style: ElevatedButton.styleFrom( + backgroundColor: Colors.blue, + padding: const EdgeInsets.symmetric(vertical: 14), + minimumSize: const Size(double.infinity, 50), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(12), + ), + ), + child: const Text("Save Transaction"), + ), + ], + ), + ), + ), + ), + ); + } + + Widget _buildDropdown({ + required String label, + required String? value, + required List items, + required Function(String?) onChanged, + }) { + return DropdownButtonFormField( + value: value, + isExpanded: true, + decoration: InputDecoration( + labelText: label, + border: OutlineInputBorder( + borderRadius: BorderRadius.circular(8), + ), + ), + items: items + .map((e) => DropdownMenuItem( + value: e, + child: Text(e), + )) + .toList(), + onChanged: onChanged, + ); + } + + Widget _buildTextField({ + required TextEditingController controller, + required String label, + TextInputType keyboardType = TextInputType.text, + }) { + return TextFormField( + controller: controller, + keyboardType: keyboardType, + decoration: InputDecoration( + labelText: label, + border: OutlineInputBorder( + borderRadius: BorderRadius.circular(8), + ), + ), + ); + } +} diff --git a/lib/financials/add_transactions.dart b/lib/financials/add_transactions.dart new file mode 100644 index 0000000..d5ba924 --- /dev/null +++ b/lib/financials/add_transactions.dart @@ -0,0 +1,151 @@ +import 'package:flutter/material.dart'; + +class AddTransactionScreen extends StatefulWidget { + @override + _AddTransactionScreenState createState() => _AddTransactionScreenState(); +} + +class _AddTransactionScreenState extends State { + final _formKey = GlobalKey(); + + String? transactionType; + String? accountName; + String? paymentMode; + String? paymentStatus; + + TextEditingController amountController = TextEditingController(text: "₹500"); + TextEditingController transactionIdController = TextEditingController(text: "₹500"); + TextEditingController dateController = TextEditingController(); + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + backgroundColor: Colors.white, + elevation: 0, + leading: Icon(Icons.arrow_back, color: Colors.black), + title: Text( + "Add Transaction", + style: TextStyle(color: Colors.black, fontWeight: FontWeight.w600), + ), + actions: [ + TextButton( + onPressed: () {}, + child: Text("HELP", style: TextStyle(color: Colors.purple)), + ) + ], + ), + body: Padding( + padding: const EdgeInsets.all(16.0), + child: Form( + key: _formKey, + child: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + buildDropdown("Transaction Type *", ["Credit", "Debit"], transactionType, (val) { + setState(() => transactionType = val); + }), + SizedBox(height: 16), + buildDropdown("Account Name *", ["Name1", "Name2"], accountName, (val) { + setState(() => accountName = val); + }), + SizedBox(height: 16), + buildTextField("Amount (in ₹) *", amountController), + SizedBox(height: 16), + Row( + children: [ + Expanded( + child: buildDropdown("Payment Mode *", ["Cash", "Card", "UPI"], paymentMode, (val) { + setState(() => paymentMode = val); + }), + ), + SizedBox(width: 12), + Expanded( + child: buildDatePicker(), + ), + ], + ), + SizedBox(height: 16), + buildTextField("Transaction ID *", transactionIdController), + SizedBox(height: 16), + buildDropdown("Payment Status *", ["Pending", "Completed", "Failed"], paymentStatus, (val) { + setState(() => paymentStatus = val); + }), + SizedBox(height: 24), + SizedBox( + width: double.infinity, + child: ElevatedButton( + style: ElevatedButton.styleFrom( + backgroundColor: Color(0xFF8270DB), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(12), + ), + padding: EdgeInsets.symmetric(vertical: 14), + ), + onPressed: () { + if (_formKey.currentState!.validate()) { + // Handle save + } + }, + child: Text("Save", style: TextStyle(color: Colors.white, fontSize: 16)), + ), + ) + ], + ), + ), + ), + ), + ); + } + + Widget buildDropdown(String label, List items, String? value, Function(String?) onChanged) { + return DropdownButtonFormField( + decoration: InputDecoration( + labelText: label, + border: OutlineInputBorder(borderRadius: BorderRadius.circular(8)), + contentPadding: EdgeInsets.symmetric(horizontal: 12, vertical: 12), + ), + value: value, + items: items.map((e) => DropdownMenuItem(value: e, child: Text(e))).toList(), + onChanged: onChanged, + ); + } + + Widget buildTextField(String label, TextEditingController controller) { + return TextFormField( + controller: controller, + decoration: InputDecoration( + labelText: label, + border: OutlineInputBorder(borderRadius: BorderRadius.circular(8)), + contentPadding: EdgeInsets.symmetric(horizontal: 12, vertical: 12), + ), + ); + } + + Widget buildDatePicker() { + return TextFormField( + controller: dateController, + readOnly: true, + decoration: InputDecoration( + labelText: "Date *", + suffixIcon: Icon(Icons.calendar_today), + border: OutlineInputBorder(borderRadius: BorderRadius.circular(8)), + contentPadding: EdgeInsets.symmetric(horizontal: 12, vertical: 12), + ), + onTap: () async { + DateTime? picked = await showDatePicker( + context: context, + initialDate: DateTime.now(), + firstDate: DateTime(2000), + lastDate: DateTime(2100), + ); + if (picked != null) { + setState(() { + dateController.text = "${picked.day}-${picked.month}-${picked.year}"; + }); + } + }, + ); + } +} diff --git a/lib/financials/building_transactions_details.dart b/lib/financials/building_transactions_details.dart new file mode 100644 index 0000000..3f82ec1 --- /dev/null +++ b/lib/financials/building_transactions_details.dart @@ -0,0 +1,296 @@ +import 'package:flutter/material.dart'; +import 'package:supplier_new/financials/add_transaction_for_credit_account.dart'; + +class BuildingTransactionsDetails extends StatefulWidget { + const BuildingTransactionsDetails({super.key}); + + @override + State createState() => _BuildingTransactionsDetailsState(); +} + +class _BuildingTransactionsDetailsState extends State { + @override + Widget build(BuildContext context) { + return Scaffold( + floatingActionButton: SizedBox( + width: 52, // default is 56 + height: 52, // make it bigger + child: FloatingActionButton( + shape: const CircleBorder(), // ensures perfect round shape + backgroundColor: Colors.black, + onPressed: (){ + Navigator.push( + context, + MaterialPageRoute( + builder: (_) => AddCreditTransactionPage(), + ), + ); + + }, + child:Image.asset( + "images/plus.png", // your custom image + width: 20, + height: 20, + color: Colors.white, // optional: apply tint + ), + ), + ), + body: SafeArea( + child: Column( + children: [ + // Header + Padding( + padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + const Text( + "Green Valley Apartments", + style: TextStyle( + fontSize: 18, + fontWeight: FontWeight.w600, + ), + ), + const SizedBox(height: 4), + Text( + "Gachibowli", + style: TextStyle( + fontSize: 14, + color: Colors.grey.shade600, + ), + ), + ], + ), + TextButton( + onPressed: () {}, + child: const Text( + "HELP", + style: TextStyle(color: Colors.blue), + ), + ) + ], + ), + ), + + // Statement button + Padding( + padding: const EdgeInsets.symmetric(horizontal: 16), + child: Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + OutlinedButton.icon( + style: OutlinedButton.styleFrom( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(8), + ), + ), + onPressed: () {}, + icon: const Icon(Icons.download), + label: const Text("Statement"), + ), + ], + ), + ), + + // Orders and balances + Padding( + padding: const EdgeInsets.all(16), + child: Container( + padding: const EdgeInsets.all(16), + decoration: BoxDecoration( + color: Colors.grey.shade100, + borderRadius: BorderRadius.circular(12), + ), + child: Column( + children: [ + // Total orders + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + const Text( + "Total Orders", + style: TextStyle(fontSize: 16), + ), + Column( + crossAxisAlignment: CrossAxisAlignment.end, + children: const [ + Text( + "45", + style: TextStyle( + fontSize: 22, fontWeight: FontWeight.bold), + ), + Text( + "12 complete", + style: + TextStyle(fontSize: 13, color: Colors.grey), + ) + ], + ) + ], + ), + const SizedBox(height: 16), + // Balances + Row( + children: [ + Expanded( + child: Container( + padding: const EdgeInsets.all(12), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(12), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: const [ + Text("Receivable Balance"), + SizedBox(height: 4), + Text( + "₹24,000", + style: TextStyle( + fontSize: 18, + fontWeight: FontWeight.bold, + color: Colors.red), + ), + SizedBox(height: 2), + Text( + "40.61% of total credit", + style: TextStyle( + fontSize: 12, color: Colors.grey), + ) + ], + ), + ), + ), + const SizedBox(width: 12), + Expanded( + child: Container( + padding: const EdgeInsets.all(12), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(12), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: const [ + Text("Advance Balance"), + SizedBox(height: 4), + Text( + "₹24,000", + style: TextStyle( + fontSize: 18, + fontWeight: FontWeight.bold, + color: Colors.green), + ), + SizedBox(height: 2), + Text( + "60.41% of total credit", + style: TextStyle( + fontSize: 12, color: Colors.grey), + ) + ], + ), + ), + ), + ], + ), + ], + ), + ), + ), + + // Buttons + Padding( + padding: const EdgeInsets.symmetric(horizontal: 16), + child: Row( + children: [ + Expanded( + child: ElevatedButton( + onPressed: () {}, + style: ElevatedButton.styleFrom( + backgroundColor: Colors.blue, + padding: const EdgeInsets.symmetric(vertical: 14), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(12), + ), + ), + child: const Text("Add Transaction"), + ), + ), + const SizedBox(width: 12), + Expanded( + child: OutlinedButton( + onPressed: () {}, + style: OutlinedButton.styleFrom( + padding: const EdgeInsets.symmetric(vertical: 14), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(12), + ), + ), + child: const Text("Request Top up"), + ), + ), + ], + ), + ), + + const SizedBox(height: 12), + + // History label + const Padding( + padding: EdgeInsets.symmetric(horizontal: 16), + child: Align( + alignment: Alignment.centerLeft, + child: Text( + "HISTORY", + style: TextStyle(fontWeight: FontWeight.w600, fontSize: 15), + ), + ), + ), + + const SizedBox(height: 8), + + // History list + Expanded( + child: ListView( + padding: const EdgeInsets.symmetric(horizontal: 16), + children: [ + _historyItem( + "Transaction Description", "21 August", "+ ₹2,580", true), + _historyItem( + "Transaction Description", "19 August", "- ₹748", false), + _historyItem( + "Transaction Description", "16 August", "- ₹10,000", false), + _historyItem( + "Transaction Description", "12 August", "- ₹500", false), + ], + ), + ), + ], + ), + ), + ); + } + + Widget _historyItem( + String title, String date, String amount, bool isCredit) { + return ListTile( + contentPadding: EdgeInsets.zero, + leading: CircleAvatar( + backgroundColor: Colors.blue.shade100, + child: const Icon(Icons.swap_horiz, color: Colors.blue), + ), + title: Text(title), + subtitle: Text(date), + trailing: Text( + amount, + style: TextStyle( + fontWeight: FontWeight.bold, + color: isCredit ? Colors.green : Colors.red, + ), + ), + ); + } +} diff --git a/lib/financials/create_credit_accounts.dart b/lib/financials/create_credit_accounts.dart new file mode 100644 index 0000000..2fe3148 --- /dev/null +++ b/lib/financials/create_credit_accounts.dart @@ -0,0 +1,143 @@ +import 'package:flutter/material.dart'; +import 'package:dropdown_button2/dropdown_button2.dart'; + +class CreateCreditAccountScreen extends StatefulWidget { + @override + _CreateCreditAccountScreenState createState() => _CreateCreditAccountScreenState(); +} +class _CreateCreditAccountScreenState extends State { + String? selectedCustomer; + String paymentTerm = 'Net 30'; + final creditLimitController = TextEditingController(text: '₹500'); + final openingBalanceController = TextEditingController(text: '₹500'); + final List> customers = [ + {'name': 'Ramakrishna', 'date': '20 August'}, + {'name': 'Mallesham Water Supplies', 'date': '21 August'}, + {'name': 'My Home Bhooja', 'date': '21 August'}, + ]; + final List paymentTerms = ['Net 15', 'Net 30', 'Net 45']; + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: Text('Create Credit Account'), + actions: [ + TextButton( + onPressed: () {}, + child: Text('HELP', style: TextStyle(color: Colors.blue)), + ) + ], + backgroundColor: Colors.white, + foregroundColor: Colors.black, + elevation: 1, + ), + body: Padding( + padding: const EdgeInsets.all(16), + child: ListView( + children: [ + Text('SELECT CUSTOMER', style: TextStyle(fontWeight: FontWeight.bold)), + const SizedBox(height: 10), + ...customers.map((customer) { + return GestureDetector( + onTap: () { + setState(() { + selectedCustomer = customer['name']; + }); + }, + child: Container( + margin: const EdgeInsets.only(bottom: 10), + padding: const EdgeInsets.all(12), + decoration: BoxDecoration( + border: Border.all( + color: selectedCustomer == customer['name'] ? Colors.black : Colors.grey.shade300, + width: 1.5, + ), + borderRadius: BorderRadius.circular(8), + color: Colors.white, + ), + child: Row( + children: [ + CircleAvatar(child: Icon(Icons.person)), + const SizedBox(width: 10), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text(customer['name']!, style: TextStyle(fontSize: 16)), + Text(customer['date']!, style: TextStyle(color: Colors.grey)), + ], + ) + ], + ), + ), + ); + }), + const SizedBox(height: 20), + Text('ENTER DETAILS', style: TextStyle(fontWeight: FontWeight.bold)), + const SizedBox(height: 10), + TextField( + controller: creditLimitController, + keyboardType: TextInputType.number, + decoration: InputDecoration( + labelText: 'Credit Limit (in ₹) *', + border: OutlineInputBorder(), + ), + ), + const SizedBox(height: 15), + DropdownButtonFormField2( + decoration: InputDecoration( + labelText: 'Payment Terms *', + border: OutlineInputBorder(), + ), + value: paymentTerm, + items: paymentTerms.map((term) { + return DropdownMenuItem( + value: term, + child: Text(term), + ); + }).toList(), + onChanged: (value) { + setState(() { + paymentTerm = value!; + }); + }, + ), + const SizedBox(height: 15), + TextField( + controller: openingBalanceController, + keyboardType: TextInputType.number, + decoration: InputDecoration( + labelText: 'Opening Balance (in ₹) *', + border: OutlineInputBorder(), + ), + ), + const SizedBox(height: 10), + Row( + children: [ + Icon(Icons.info_outline, color: Colors.orange, size: 18), + const SizedBox(width: 8), + Expanded( + child: Text( + 'Creating an Account will send the customer a notification about the details and a request to add balance to start the water delivery plan.', + style: TextStyle(color: Colors.black87, fontSize: 13), + ), + ) + ], + ), + const SizedBox(height: 20), + ElevatedButton( + onPressed: () { + // Add your submission logic here + }, + style: ElevatedButton.styleFrom( + backgroundColor: Color(0xFF9375E8), + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(30)), + minimumSize: Size(double.infinity, 50), + ), + child: Text('Create Account'), + ) + ], + ), + ), + ); + } +} \ No newline at end of file diff --git a/lib/financials/financial_main_screen.dart b/lib/financials/financial_main_screen.dart index 6472bb2..b7ec9a1 100644 --- a/lib/financials/financial_main_screen.dart +++ b/lib/financials/financial_main_screen.dart @@ -1,5 +1,8 @@ import 'package:flutter/material.dart'; import 'package:supplier_new/common/settings.dart'; +import 'package:supplier_new/financials/add_transactions.dart'; +import 'package:supplier_new/financials/building_transactions_details.dart'; +import 'package:supplier_new/financials/create_credit_accounts.dart'; class FinancialMainScreen extends StatefulWidget { @@ -55,6 +58,9 @@ class _FinancialMainScreenState extends State void initState() { super.initState(); _tabController = TabController(length: 2, vsync: this); + _tabController.addListener(() { + setState(() {}); // rebuilds FAB visibility when tab changes + }); } @override @@ -63,6 +69,50 @@ class _FinancialMainScreenState extends State super.dispose(); } + Widget fab(){ + final index = _tabController.index; + + if (index == 0) { + return SizedBox( + width: 52, + height: 52, + child: FloatingActionButton( + shape: const CircleBorder(), + backgroundColor: Colors.black, + onPressed: _onFabPressed, + child: Image.asset( + "images/plus.png", + width: 20, + height: 20, + color: Colors.white, + ), + ), + ); + } else { + return Container(); + } + } + + void _onFabPressed() { + final index = _tabController.index; + + if (index == 0) { + // Tab 1 → Navigate to Create Account + Navigator.push( + context, + MaterialPageRoute( + builder: (_) => AddTransactionScreen(), + ), + ); + } else if (index == 1) { + // Tab 2 → Navigate to Transactions + /*Navigator.push( + context, + MaterialPageRoute(builder: (_) => const TransactionsPage()), + );*/ + } + } + Widget Transactions(){ return Container( @@ -134,10 +184,345 @@ class _FinancialMainScreenState extends State } Widget CreditAccounts(){ - return Container( - color: Color(0XFFFFFFFF), - child:Center( - child: Text("Credit Accounts Coming Soon..."), + return SingleChildScrollView( + child: Padding( + padding: const EdgeInsets.all(16), + child: Column( + children: [ + // Account Summary + + Align( + alignment: Alignment.centerRight, // aligns button to the right + child: OutlinedButton( + style: OutlinedButton.styleFrom( + foregroundColor: Color(0xFFFFFFFF), + backgroundColor: Color(0xFF000000), + side: BorderSide(color: Color(0xFF000000)), + padding: EdgeInsets.symmetric(vertical: 10, horizontal: 16), // padding around content + ), + onPressed: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (_) => CreateCreditAccountScreen(), + ), + ); + }, + child: Row( + mainAxisSize: MainAxisSize.min, // shrink button to fit content + children: [ + Image.asset('images/plus.png', height: 20, width: 20), + SizedBox(width: 4), + Text( + "Create Account", + style: fontTextStyle(14, const Color(0xFFFFFFFF), FontWeight.w400), + ), + ], + ), + ), + ), + + Container( + padding: const EdgeInsets.all(16), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(16), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + const Expanded( + child: Text( + "Account Summary", + style: TextStyle( + fontSize: 16, fontWeight: FontWeight.w600), + ), + ), + Column( + children: const [ + Text( + "05", + style: TextStyle( + fontSize: 28, + fontWeight: FontWeight.bold, + color: Colors.blue), + ), + SizedBox(height: 2), + Text( + "4 active, 1 overdue", + style: TextStyle( + fontSize: 12, + color: Colors.grey, + ), + ), + ], + ), + ], + ), + const SizedBox(height: 16), + Row( + children: [ + Expanded( + child: Container( + padding: const EdgeInsets.all(12), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: const Color(0xfffafafa), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: const [ + Text( + "Receivable Balance", + style: TextStyle( + fontSize: 12, color: Colors.black54), + ), + SizedBox(height: 4), + Text( + "₹24,000", + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.bold, + color: Colors.red), + ), + Text( + "40.6% of total credit", + style: TextStyle( + fontSize: 11, color: Colors.grey), + ), + ], + ), + ), + ), + const SizedBox(width: 12), + Expanded( + child: Container( + padding: const EdgeInsets.all(12), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: const Color(0xfffafafa), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: const [ + Text( + "Advance Balance", + style: TextStyle( + fontSize: 12, color: Colors.black54), + ), + SizedBox(height: 4), + Text( + "₹24,000", + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.bold, + color: Colors.green), + ), + Text( + "60.4% of total credit", + style: TextStyle( + fontSize: 11, color: Colors.grey), + ), + ], + ), + ), + ), + ], + ), + ], + ), + ), + const SizedBox(height: 20), + + // Search Bar + Container( + padding: + const EdgeInsets.symmetric(horizontal: 12, vertical: 6), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(12), + ), + child: Row( + children: [ + const Icon(Icons.search, color: Colors.grey), + const SizedBox(width: 8), + const Expanded( + child: TextField( + decoration: InputDecoration( + hintText: "Search", + border: InputBorder.none, + ), + ), + ), + IconButton( + onPressed: () {}, + icon: const Icon(Icons.sort, color: Colors.grey), + ), + ], + ), + ), + const SizedBox(height: 20), + + // Accounts List + _accountTile( + name: "SVG Towers", + status: "active", + orders: "48 orders", + balance: "₹10,000", + credit: "₹10,000", + lastPayment: "₹5,000 | 12 Aug", + balanceColor: Colors.red, + creditColor: Colors.green, + ), + _accountTile( + name: "Canvas Creations", + status: "active", + orders: "32 orders", + balance: "₹7,500", + credit: "₹7,500", + lastPayment: "₹3,000 | 5 Aug", + balanceColor: Colors.red, + creditColor: Colors.green, + ), + _accountTile( + name: "Digital Designs", + status: "inactive", + orders: "15 orders", + balance: "₹2,000", + credit: "₹2,000", + lastPayment: "₹1,000 | 1 Aug", + balanceColor: Colors.red, + creditColor: Colors.green, + ), + ], + ), + ), + ); + } + + Widget _accountTile({ + required String name, + required String status, + required String orders, + required String balance, + required String credit, + required String lastPayment, + required Color balanceColor, + required Color creditColor, + }) { + return GestureDetector( + onTap: (){ + Navigator.push( + context, + MaterialPageRoute( + builder: (_) => BuildingTransactionsDetails(), + ), + ); + }, + child: Container( + margin: const EdgeInsets.only(bottom: 12), + padding: const EdgeInsets.all(16), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(16), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + // Name + Status + Row( + children: [ + Expanded( + child: Text( + name, + style: const TextStyle( + fontSize: 16, fontWeight: FontWeight.bold), + ), + ), + Container( + padding: + const EdgeInsets.symmetric(horizontal: 8, vertical: 4), + decoration: BoxDecoration( + color: status == "active" + ? Colors.green.withOpacity(0.1) + : Colors.red.withOpacity(0.1), + borderRadius: BorderRadius.circular(12), + ), + child: Text( + status, + style: TextStyle( + color: + status == "active" ? Colors.green : Colors.redAccent, + fontSize: 12, + fontWeight: FontWeight.w500, + ), + ), + ) + ], + ), + const SizedBox(height: 4), + Text( + orders, + style: const TextStyle(color: Colors.grey, fontSize: 12), + ), + const SizedBox(height: 12), + + // Balance - Credit - Last Payment + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + const Text("Available Balance", + style: TextStyle( + fontSize: 12, color: Colors.black54)), + const SizedBox(height: 4), + Text( + balance, + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.bold, + color: balanceColor), + ), + ], + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + const Text("Available Credit", + style: TextStyle( + fontSize: 12, color: Colors.black54)), + const SizedBox(height: 4), + Text( + credit, + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.bold, + color: creditColor), + ), + ], + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + const Text("Last Payment", + style: TextStyle( + fontSize: 12, color: Colors.black54)), + const SizedBox(height: 4), + Text( + lastPayment, + style: const TextStyle( + fontSize: 12, fontWeight: FontWeight.w500), + ), + ], + ), + ], + ) + ], + ), ), ); } @@ -148,28 +533,8 @@ class _FinancialMainScreenState extends State appBar:AppBar( elevation: 0, backgroundColor: Colors.white, - title: Text( - 'Financials', - style: fontTextStyle(14, Color(0XFF2A2A2A), FontWeight.w500), - ), - iconTheme: IconThemeData(color: Color(0XFF2A2A2A)), - leading: GestureDetector( - onTap: () { - Navigator.pop(context); - }, - child: Padding( - padding: const EdgeInsets.fromLTRB( - 8, 8, 8, 8), // Add padding if needed - child: Image.asset( - 'images/backbutton_appbar.png', - height: 24, - width: 24,// Replace with your image path - fit: BoxFit.contain, // Adjust the fit - ), - ), - ), bottom: PreferredSize( - preferredSize: const Size.fromHeight(50.0), + preferredSize: const Size.fromHeight(0.0), child: Container( height: 38, margin: const EdgeInsets.symmetric(horizontal: 16, vertical: 8), @@ -218,10 +583,9 @@ class _FinancialMainScreenState extends State CreditAccounts() ], ), - floatingActionButton: FloatingActionButton( - onPressed: () {}, - child: const Icon(Icons.add), - ), + + + floatingActionButton:_tabController.index == 0 ? fab() : null, ); } diff --git a/lib/orders/accept_order_requests.dart b/lib/orders/accept_order_requests.dart index 038bdfe..9136896 100644 --- a/lib/orders/accept_order_requests.dart +++ b/lib/orders/accept_order_requests.dart @@ -1,32 +1,81 @@ import 'package:flutter/material.dart'; +import 'package:supplier_new/common/settings.dart'; import 'package:supplier_new/orders/edit_order_requests.dart'; class AcceptOrderRequests extends StatefulWidget { var order; - AcceptOrderRequests({this.order}); + var status; + AcceptOrderRequests({this.order,this.status}); @override State createState() => _AcceptOrderRequestsState(); } class _AcceptOrderRequestsState extends State { + double advancePayable=0.0; + double advance=0.0; + double amountToPayAfterDelivery=0.0; + double totalFare=0.0; + + @override + void initState() { + // TODO: implement initState + super.initState(); + advance=150; + advancePayable = advance; + totalFare=advance+double.parse(widget.order.quoted_amount); + amountToPayAfterDelivery = totalFare - advancePayable; + } + + @override Widget build(BuildContext context) { return Scaffold( backgroundColor: Colors.white, - + extendBodyBehindAppBar: true, appBar: AppBar( - backgroundColor: Colors.white, + backgroundColor: Colors.transparent, elevation: 0, - leading: IconButton( - icon: const Icon(Icons.arrow_back, color: Colors.black), - onPressed: () => Navigator.pop(context), + scrolledUnderElevation: 0, + title: Text( + '', + style: fontTextStyle(16, Color(0XFF2A2A2A), FontWeight.w600), ), + iconTheme: IconThemeData(color: Color(0XFF2A2A2A)), actions: [ - IconButton( - icon: const Icon(Icons.help_outline, color: Colors.black), - onPressed: () {}, - ), + Row( + children: [ + Padding( + padding: EdgeInsets.fromLTRB(0, 10, 10, 10), + child: IconButton( + icon: Image.asset( + 'images/help_appbar.png', + height: 20, + width: 20, + color: Color(0XFFFFFFFF), + ), + onPressed: () {}, + ), + ) + ], + ) ], + leading: GestureDetector( + onTap: () { + Navigator.pop(context); + }, + child: Padding( + padding: + const EdgeInsets.fromLTRB(8, 8, 8, 8), // Add padding if needed + child: Image.asset( + 'images/backbutton_appbar.png', // Replace with your image path + fit: BoxFit.contain, + color: Color(0XFFFFFFFF), + height: 24, + width: 24, + + ), + ), + ), ), body: SingleChildScrollView( @@ -35,125 +84,170 @@ class _AcceptOrderRequestsState extends State { children: [ /// 🔹 Top Card with Image Stack( + clipBehavior: Clip.none, children: [ + /// 🔹 Background Image ClipRRect( - borderRadius: BorderRadius.circular(12), + borderRadius: const BorderRadius.only( + bottomLeft: Radius.circular(0), + bottomRight: Radius.circular(0), + ), child: Image.asset( - "images/building.png", // replace with network image - height: 180, + "images/building.png", + height: 220, width: double.infinity, fit: BoxFit.cover, ), ), - /// Status Chip + /// 🔹 Floating Info Card (half on image, half below) Positioned( - top: 12, + bottom: -40, // pulls the card out by 40px left: 12, + right: 12, child: Container( - padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4), + padding: const EdgeInsets.all(12), decoration: BoxDecoration( - color: Colors.blue.withOpacity(0.1), - borderRadius: BorderRadius.circular(8), + color: Colors.white, + borderRadius: BorderRadius.circular(12), + boxShadow: [ + BoxShadow( + color: Colors.black12, + blurRadius: 6, + offset: Offset(0, 3), + ), + ], ), - child: const Text( - "New", - style: TextStyle( - color: Colors.blue, - fontWeight: FontWeight.w600, - fontSize: 12, - ), + child: Row( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4), + decoration: BoxDecoration( + color: Color(0XFFFFFFFF), + borderRadius: BorderRadius.circular(4), + border: Border.all( + color: widget.status.statusColor, + width: 0.5, + ), + ), + child: Text( + widget.status.status, + style: fontTextStyle(12, widget.status.statusColor, FontWeight.w500) + ), + ), + Text( + widget.order.building_name, + style: fontTextStyle(20, const Color(0XFF2D2E30), FontWeight.w600), + ), + SizedBox(height: 4), + Text( + widget.order.displayAddress, + style: fontTextStyle(12, const Color(0XFF939495), FontWeight.w400), + ), + ], + ), + const Spacer(), + Text( + widget.order.distanceInKm.toString()+'Km', + style: fontTextStyle(12, const Color(0XFF939495), FontWeight.w400), + ), + ], ), ), ), ], ), + SizedBox(height:MediaQuery.of(context).size.height * .08,), - /// Title + Location + Distance + /// 🔹 Order Details Padding( - padding: const EdgeInsets.all(12), + padding: EdgeInsets.fromLTRB(16,0,16,0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, - children: const [ - Text( - "Club Kohinoor", - style: TextStyle( - fontSize: 18, - fontWeight: FontWeight.w600, - ), + children: [ + Text( + "ORDER DETAILS", + style: fontTextStyle(10, const Color(0XFF2D2E30), FontWeight.w600), ), - SizedBox(height: 4), - Text( - "Banjara Hills, Hyderabad • 5.5 Km", - style: TextStyle( - fontSize: 13, - color: Colors.grey, - ), + SizedBox(height:MediaQuery.of(context).size.height * .011,), + _detailTwoRow( + "Tanker Price", "₹${AppSettings.formDouble(widget.order.quoted_amount) ?? ''}","images/financialsBottomIcon.png", + "", "","" ), + SizedBox(height:MediaQuery.of(context).size.height * .02,), + _detailTwoRow( + "Water Type", "${widget.order.type_of_water}","images/water.png", + "Date of Delivery", "${widget.order.time}","images/calendar_appbar.png", + ), + SizedBox(height:MediaQuery.of(context).size.height * .02,), + _detailTwoRow( + "Capacity", "${widget.order.capacity}","images/capacity.png", + "Time of Delivery", "${widget.order.averageTime}","images/time.png", + ), + SizedBox(height:MediaQuery.of(context).size.height * .02,), + _detailTwoRow( + "Quantity", "${widget.order.quantity}","images/quantity.png", + "Booking Charges", advance.toString(),"images/advance.png", + ), + ], ), ), - - const Divider(), - - /// 🔹 Order Details + SizedBox(height:MediaQuery.of(context).size.height * .008,), + /// 🔹 Additional Details Padding( - padding: const EdgeInsets.all(12), + padding: EdgeInsets.fromLTRB(16,0,16,16), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - const Text( - "ORDER DETAILS", - style: TextStyle( - fontSize: 14, - fontWeight: FontWeight.w600, - ), + Text( + "ADDITIONAL DETAILS", + style: fontTextStyle(10, const Color(0XFF2D2E30), FontWeight.w600), + ), + SizedBox(height:MediaQuery.of(context).size.height * .011,), + Text( + "Lorem ipsum dolor sit amet, consectetur adipiscing elit, " + "sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. " + "Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut " + "aliquip ex ea commodo consequat.", + style: fontTextStyle(12, const Color(0XFF646566), FontWeight.w400), ), - const SizedBox(height: 12), - - _detailRow("Tanker Price", "₹ ${widget.order.quoted_amount}"), - _detailRow("Water Type", " ${widget.order.type_of_water}"), - _detailRow("Date of Delivery", "${widget.order.time}"), - _detailRow("Capacity", "${widget.order.capacity}"), - _detailRow("Time of Delivery", "${widget.order.averageTime}"), - _detailRow("Quantity", "${widget.order.quantity}"), - _detailRow("Advance", "10%"), ], - ), - ), + ) - const Divider(), - /// 🔹 Additional Details - const Padding( - padding: EdgeInsets.all(12), - child: Text( - "ADDITIONAL DETAILS\n\nLorem ipsum dolor sit amet, consectetur adipiscing elit, " - "sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. " - "Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut " - "aliquip ex ea commodo consequat.", - style: TextStyle(fontSize: 13, color: Colors.black87, height: 1.4), - ), ), - const Divider(), - /// 🔹 Payment Summary Padding( - padding: const EdgeInsets.all(12), + padding: EdgeInsets.fromLTRB(16,0,16,16), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - const Text( + Text( "PAYMENT SUMMARY", - style: TextStyle( - fontSize: 14, - fontWeight: FontWeight.w600, - ), + style: fontTextStyle(10, const Color(0XFF2D2E30), FontWeight.w600), ), - const SizedBox(height: 12), - _detailRow("Tanker Price", "₹ 1,500"), - _detailRow("Advance", "10%"), + SizedBox(height:MediaQuery.of(context).size.height * .011,), + _detailRow("Tanker Price", "₹${AppSettings.formDouble(widget.order.quoted_amount) ?? ''}"), + SizedBox(height:MediaQuery.of(context).size.height * .004,), + _detailRow("Booking Charges", "₹ "+advance.toString()), + SizedBox(height:MediaQuery.of(context).size.height * .004,), + _detailRow("Total Amount", "₹ "+totalFare.toString()), + SizedBox(height:MediaQuery.of(context).size.height * .004,), + Divider(color: Color(0XFF646566), + thickness: 0.3,), + SizedBox(height:MediaQuery.of(context).size.height * .004,), + _detailRow("Booking Charges Payable",'₹${AppSettings.formDouble(advancePayable.toString()) ?? ''}' + + ), + SizedBox(height:MediaQuery.of(context).size.height * .004,), + _detailRow("Amount to Pay (After Delivery)", '₹${AppSettings.formDouble(amountToPayAfterDelivery.toString()) ?? ''}' + ), ], ), ), @@ -167,50 +261,101 @@ class _AcceptOrderRequestsState extends State { bottomNavigationBar: Container( padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 8), decoration: BoxDecoration( - color: Colors.white, - border: Border(top: BorderSide(color: Colors.grey.shade300)), + color: Color(0XFFFFFFFF), + border: Border(top: BorderSide(color: Color(0XFFF5F6F6))), ), child: Row( children: [ Expanded( child: OutlinedButton( + style: OutlinedButton.styleFrom( + foregroundColor: Color(0XFF000000), + backgroundColor: Color(0xFFF1F1F1), + side: BorderSide(color: Color(0xFFF1F1F1)), + padding: EdgeInsets.symmetric(vertical: 10), // uniform height + ), onPressed: () { - Navigator.push( context, MaterialPageRoute( - builder: (_) => EditOrderRequests(order: widget.order,advance:"10%" ,), + builder: (_) => EditOrderRequests( + order: widget.order, + advance: advance.toString(), + status: widget.status, + ), ), ); - }, - child: const Text("Edit Order"), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Image.asset('images/edit.png', height: 20, width: 20), + SizedBox(width: 4), + Text( + "Edit Order", + style: fontTextStyle(14, const Color(0XFF000000), FontWeight.w400), + ), + ], + ), ), ), - const SizedBox(width: 8), + + SizedBox(width: 8), + Expanded( child: OutlinedButton( style: OutlinedButton.styleFrom( - foregroundColor: Colors.red, - side: const BorderSide(color: Colors.red), + foregroundColor: Color(0XFFE2483D), + backgroundColor: Colors.white, + side: BorderSide(color: Color(0XFFE2483D)), + padding: EdgeInsets.symmetric(vertical: 10), ), onPressed: () {}, - child: const Text("Reject"), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Image.asset('images/cross.png', height: 20, width: 20), + SizedBox(width: 4), + Text( + "Reject", + style: fontTextStyle(14, const Color(0XFF000000), FontWeight.w400), + ), + ], + ), ), ), - const SizedBox(width: 8), + + SizedBox(width: 8), + Expanded( child: ElevatedButton( style: ElevatedButton.styleFrom( - backgroundColor: Colors.green, - foregroundColor: Colors.white, + backgroundColor: Color(0XFF0A9E04), + foregroundColor: Color(0XFFFFFFFF), + padding: EdgeInsets.symmetric(vertical: 10), + ), + onPressed: () { + + + + }, + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Image.asset('images/rite.png', height: 20, width: 20), + SizedBox(width: 4), + Text( + "Accept", + style: fontTextStyle(14, const Color(0XFFFFFFFF), FontWeight.w400), + ), + ], ), - onPressed: () {}, - child: const Text("Accept"), ), ), ], - ), + ) + + ), ); } @@ -218,17 +363,74 @@ class _AcceptOrderRequestsState extends State { /// 🔹 Helper widget for rows Widget _detailRow(String title, String value) { return Padding( - padding: const EdgeInsets.symmetric(vertical: 6), + padding: const EdgeInsets.symmetric(vertical: 0), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text(title, - style: const TextStyle(fontSize: 13, color: Colors.grey)), + style: fontTextStyle(12, const Color(0XFF646566), FontWeight.w400),), Text(value, - style: const TextStyle( - fontSize: 13, fontWeight: FontWeight.w600)), + style: fontTextStyle(12, const Color(0XFF2D2E30), FontWeight.w500),), ], ), ); } + + Widget _detailTwoRow( + String title1, + String value1, + String path1, + String title2, + String value2, + String path2, { + EdgeInsetsGeometry padding = const EdgeInsets.symmetric(vertical: 6), + }) { + final titleStyle = fontTextStyle(12, Color(0XFF646566), FontWeight.w400); + final valueStyle = fontTextStyle(12, Color(0XFF343637), FontWeight.w500); + + Widget _col(String t, String v, String path) { + return Expanded( + child: Padding( + padding: const EdgeInsets.only(right: 8.0), + child: Row( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + if (path.isNotEmpty) + Image.asset( + path, + fit: BoxFit.contain, + height: 20, + width: 20, + color: const Color(0XFFC3C4C4), + ), + if (path.isNotEmpty) const SizedBox(width: 6), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text(t, style: titleStyle, maxLines: 1, overflow: TextOverflow.ellipsis), + Text(v, style: valueStyle, maxLines: 1, overflow: TextOverflow.ellipsis), + ], + ), + ) + ], + ), + ), + ); + } + + return Padding( + padding: padding, + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + _col(title1, value1, path1), + _col(title2, value2, path2), + ], + ), + ); + } + + + } diff --git a/lib/orders/all_orders.dart b/lib/orders/all_orders.dart index 465a4f6..216152c 100644 --- a/lib/orders/all_orders.dart +++ b/lib/orders/all_orders.dart @@ -6,8 +6,11 @@ import 'package:supplier_new/orders/search_order_appbar.dart'; import 'package:intl/intl.dart'; class AllOrders extends StatefulWidget { - const AllOrders({super.key}); - + final String navigationFrom; + AllOrders({ + super.key, + required this.navigationFrom, + }); @override State createState() => _AllOrdersState(); } @@ -82,14 +85,15 @@ class _AllOrdersState extends State { } return Scaffold( backgroundColor: Color(0XFFF2F2F2), - appBar: SearchOrderAppBar( + appBar: widget.navigationFrom.toString().toLowerCase()=='dashboard'? + SearchOrderAppBar( controller: searchController, onBack: () => Navigator.pop(context), onHelp: () { // Show help dialog or navigate print("Help tapped"); }, - ), + ):null, body: SingleChildScrollView( child: Padding( diff --git a/lib/orders/edit_order_requests.dart b/lib/orders/edit_order_requests.dart index c5671f1..e8e2164 100644 --- a/lib/orders/edit_order_requests.dart +++ b/lib/orders/edit_order_requests.dart @@ -1,9 +1,11 @@ import 'package:flutter/material.dart'; +import 'package:supplier_new/common/settings.dart'; class EditOrderRequests extends StatefulWidget { var order; String? advance; - EditOrderRequests({this.order,this.advance}); + var status; + EditOrderRequests({this.order,this.advance,this.status}); @override State createState() => _EditOrderRequestsState(); @@ -30,11 +32,11 @@ class _EditOrderRequestsState extends State { advanceController.text='${widget.advance}'; // Update summary in real-time as user types tankerPriceController.addListener(() => setState(() {})); - capacityController.addListener(() => setState(() {})); + /*capacityController.addListener(() => setState(() {})); quantityController.addListener(() => setState(() {})); dateController.addListener(() => setState(() {})); timeController.addListener(() => setState(() {})); - waterTypeController.addListener(() => setState(() {})); + waterTypeController.addListener(() => setState(() {}));*/ advanceController.addListener(() => setState(() {})); } @@ -43,25 +45,42 @@ class _EditOrderRequestsState extends State { int tankerPrice = int.tryParse(tankerPriceController.text) ?? 0; int updatedQuantity=int.tryParse(quantityController.text) ?? 0; String updatedCapacity=capacityController.text ?? ''; - int totalPrice = tankerPrice * updatedQuantity; - double advancePercent = - double.tryParse(advanceController.text.replaceAll('%', '')) ?? 0; - int advancePayable = (totalPrice * (advancePercent / 100)).round(); + // Parse booking/advance as a double to accept "150.0" then convert to int (round) + double bookingChargesDouble = double.tryParse(advanceController.text.trim()) ?? 0.0; + int bookingCharges = bookingChargesDouble.round(); // or .toInt() / .floor() as you prefer + + int totalPrice = (tankerPrice * updatedQuantity) + bookingCharges; + int advancePayable = bookingCharges; // + int amountToPayAfterDelivery=totalPrice-bookingCharges; return Scaffold( backgroundColor: Colors.white, appBar: AppBar( - backgroundColor: Colors.white, + backgroundColor: Colors.white, elevation: 0, - leading: IconButton( - icon: const Icon(Icons.close, color: Colors.black), - onPressed: () => Navigator.pop(context), + scrolledUnderElevation: 0, + title: Text( + 'Edit Order', + style: fontTextStyle(16, Color(0XFF2A2A2A), FontWeight.w600), ), - title: const Text( - "Edit Order", - style: TextStyle(color: Colors.black, fontWeight: FontWeight.w600), + leading: GestureDetector( + onTap: () { + Navigator.pop(context); + }, + child: Padding( + padding: + const EdgeInsets.fromLTRB(16, 8, 8, 8), // Add padding if needed + child: Image.asset( + 'images/cross.png', // Replace with your image path + fit: BoxFit.contain, + color: Color(0XFF2A2A2A), + height: 24, + width: 24, + + ), + ), ), - centerTitle: true, + iconTheme: IconThemeData(color: Color(0XFF2A2A2A)), ), body: SingleChildScrollView( padding: const EdgeInsets.all(16), @@ -69,92 +88,146 @@ class _EditOrderRequestsState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ // 🔹 Club Info Card - Container( - padding: const EdgeInsets.all(12), - decoration: BoxDecoration( - border: Border.all(color: Colors.grey.shade300), - borderRadius: BorderRadius.circular(12), - ), - child: Row( - children: [ - Expanded( - child: Column( + Material( + elevation: 4, // shadow depth + borderRadius: BorderRadius.circular(12), + child: Container( + padding: const EdgeInsets.all(12), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white, // Material needs a background color + border: Border.all(color: Color(0XFFC9C2F0),width: 0.5), + ), + child: Row( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Column( crossAxisAlignment: CrossAxisAlignment.start, - children: const [ - Chip( - label: Text("New", - style: TextStyle( - color: Colors.blue, - fontSize: 12, - fontWeight: FontWeight.w600)), - backgroundColor: Color(0xFFEAF3FF), - padding: EdgeInsets.symmetric(horizontal: 4), + children: [ + Container( + padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4), + decoration: BoxDecoration( + color: Color(0XFFFFFFFF), + borderRadius: BorderRadius.circular(4), + border: Border.all( + color: widget.status.statusColor, + width: 0.5, + ), + ), + child: Text( + widget.status.status, + style: fontTextStyle(12, widget.status.statusColor, FontWeight.w500) + ), ), - Text("Club Kohinoor", - style: TextStyle( - fontSize: 18, fontWeight: FontWeight.w600)), SizedBox(height: 4), - Text("Banjara Hills, Hyderabad", - style: TextStyle(color: Colors.grey, fontSize: 13)), + Text( + widget.order.building_name, + style: fontTextStyle(20, const Color(0XFF2D2E30), FontWeight.w600), + ), + Text( + widget.order.displayAddress, + style: fontTextStyle(12, const Color(0XFF939495), FontWeight.w400), + ), ], ), - ), - const Text("5.5 Km", style: TextStyle(color: Colors.black54)), - ], + const Spacer(), + Text( + widget.order.distanceInKm.toString()+'Km', + style: fontTextStyle(12, const Color(0XFF939495), FontWeight.w400), + ), + ], + ), ), ), - const SizedBox(height: 20), - const Text("ORDER DETAILS", - style: TextStyle(fontWeight: FontWeight.w600, fontSize: 14)), + + SizedBox(height:MediaQuery.of(context).size.height * .06,), + Text("ORDER DETAILS", + style: fontTextStyle(12, const Color(0XFF2D2E30), FontWeight.w600),), const SizedBox(height: 12), // 🔹 Two in a row - _twoFields(tankerPriceController, "Tanker Price", null, null), - _twoFields(capacityController, "Capacity", quantityController, "Quantity"), - _twoFields(waterTypeController, "Water Type",advanceController, "Advance"), - _twoFields(dateController, "Date",timeController, "Time Of Delivery"), + _twoFields(tankerPriceController, "Tanker Price",'images/price.png',false, null, null,null,null), + _twoFields(capacityController, "Capacity",'images/capacity.png',true,quantityController, "Quantity",'images/quantity.png',true), + _twoFields(waterTypeController, "Water Type",'images/water.png',true,advanceController, "Booking Charges",'images/advance.png',false), + _twoFields(dateController, "Date",'images/calendar_appbar.png',true,timeController, "Time Of Delivery",'images/time.png',true), const SizedBox(height: 20), - const Text("UPDATED PAYMENT SUMMARY", - style: TextStyle(fontWeight: FontWeight.w600, fontSize: 14)), + Text("UPDATED PAYMENT SUMMARY", + style: fontTextStyle(12,Color(0XFF2D2E30),FontWeight.w600),), const SizedBox(height: 12), _summaryRow("Tanker Price", "₹ $tankerPrice"), _summaryRow("Quantity", " $updatedQuantity"), _summaryRow("Capacity", "$updatedCapacity"), + _summaryRow("Booking Charges", "₹ $bookingCharges"), _summaryRow("Total Price", "₹ $totalPrice"), const Divider(), - _summaryRow("Advance", advanceController.text), - _summaryRow("Advance Payable", "₹ $advancePayable"), + + _summaryRow("Booking Charges Payable", "₹ $advancePayable"), + _summaryRow("Amount to Pay (After Delivery)", "₹ $amountToPayAfterDelivery"), ], ), ), bottomNavigationBar: Container( - padding: const EdgeInsets.all(12), + padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 8), decoration: BoxDecoration( - color: Colors.white, - border: Border(top: BorderSide(color: Colors.grey.shade300)), + color: Color(0XFFFFFFFF), + border: Border(top: BorderSide(color: Color(0XFFF5F6F6))), ), child: Row( children: [ Expanded( child: OutlinedButton( - onPressed: () => Navigator.pop(context), - child: const Text("Cancel"), + style: OutlinedButton.styleFrom( + foregroundColor: Color(0XFF000000), + backgroundColor: Color(0xFFFFFFFF), + side: BorderSide(color: Color(0xFF939495)), + padding: EdgeInsets.symmetric(vertical: 10), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(24), // <-- radius here + ), + ), + onPressed: () { + Navigator.pop(context); + }, + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + + Text( + "Cancel", + style: fontTextStyle(14, const Color(0XFF000000), FontWeight.w400), + ), + ], + ), ), ), const SizedBox(width: 8), Expanded( - child: ElevatedButton( - style: ElevatedButton.styleFrom( - backgroundColor: Colors.deepPurple, - foregroundColor: Colors.white, + child: OutlinedButton( + style: OutlinedButton.styleFrom( + foregroundColor: Color(0XFFFFFFFF), + backgroundColor: Color(0xFF8270DB), + side: BorderSide(color: Color(0xFF8270DB)), + padding: EdgeInsets.symmetric(vertical: 10), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(24), // <-- radius here + ), ), onPressed: () { - // 🔹 Collect updated values - print("Tanker Price: ${tankerPriceController.text}"); - print("Water Type: ${waterTypeController.text}"); - // Save logic here + }, - child: const Text("Send ➤"), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + + Text( + "Send", + style: fontTextStyle(14, const Color(0XFFFFFFFF), FontWeight.w400), + ), + SizedBox(width: 12), + Image.asset('images/send.png', height: 20, width: 20), + + ], + ), ), ), ], @@ -164,36 +237,72 @@ class _EditOrderRequestsState extends State { } /// 🔹 Two fields side by side - Widget _twoFields(TextEditingController? controller1, String? label1, - TextEditingController? controller2, String? label2) { + Widget _twoFields(TextEditingController? controller1, String? label1,String? path1, bool? readOnly1, + TextEditingController? controller2, String? label2,String? path2,bool? readOnly2) { return Row( children: [ Expanded( - child: _textField(controller1, label1), + child: _textField(controller1, label1,path1,readOnly1!), ), const SizedBox(width: 10), if (controller2 != null) Expanded( - child: _textField(controller2, label2), + child: _textField(controller2, label2,path2,readOnly2!), ), ], ); } /// 🔹 Custom text field - Widget _textField(TextEditingController? controller, String? label) { + Widget _textField(TextEditingController? controller, String? label,String? path,bool readOnly) { return Container( margin: const EdgeInsets.only(bottom: 12), child: TextField( controller: controller, + cursorColor: primaryColor, + readOnly: readOnly, decoration: InputDecoration( - labelText: label, + counterText: '', + filled: false, + fillColor: Colors.white, + prefixIcon: Padding( + padding: const EdgeInsets.symmetric(horizontal: 6.0, vertical: 6.0), + child: SizedBox( + width: 18, + height: 18, + child: Image.asset( + path!, + fit: BoxFit.contain, + color: Color(0XFFC3C4C4), + ), + ), + ), + prefixIconConstraints: BoxConstraints( + minWidth: 24, + minHeight: 24, + ), border: OutlineInputBorder( - borderRadius: BorderRadius.circular(10), + borderRadius: BorderRadius.circular(4.0), + borderSide: BorderSide(color: Color(0XFFC3C4C4), + width: 1,)), + focusedBorder: !readOnly?OutlineInputBorder( + borderRadius: BorderRadius.circular(4.0), + borderSide: BorderSide(color: Color(0XFF8270DB),width: 1,), + ):OutlineInputBorder( + borderRadius: BorderRadius.circular(4.0), + borderSide: BorderSide(color: Color(0XFFC3C4C4),width: 1,), ), - contentPadding: - const EdgeInsets.symmetric(horizontal: 12, vertical: 10), + + enabledBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(4.0), + borderSide: BorderSide(color: Color(0XFFC3C4C4)), + ), + labelText: label, + labelStyle:fontTextStyle(12,Color(0XFF646566),FontWeight.w400), + /* TextStyle(color: greyColor, fontWeight: FontWeight.bold //<-- SEE HERE + ),*/ ), + style:fontTextStyle(12,Color(0XFF343637),FontWeight.w500), ), ); } @@ -205,12 +314,12 @@ class _EditOrderRequestsState extends State { child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Text(title, style: const TextStyle(color: Colors.black54)), + Text(title, style: fontTextStyle(12,Color(0XFF646566),FontWeight.w400),), Text(value, - style: const TextStyle( - fontWeight: FontWeight.w600, color: Colors.black)), + style: fontTextStyle(12,Color(0XFF2D2E30),FontWeight.w500),), ], ), ); } + } diff --git a/lib/orders/order_requests.dart b/lib/orders/order_requests.dart index a40362d..bdb71cd 100644 --- a/lib/orders/order_requests.dart +++ b/lib/orders/order_requests.dart @@ -31,7 +31,7 @@ class _OrderRequestsPageState extends State { final data = (jsonDecode(response)['data'] as List) .map((e) => OrderRequestsModel.fromJson(e)) .toList(); - + if (!mounted) return; setState(() { orderRequestsList = data; isLoading = false; @@ -58,8 +58,8 @@ class _OrderRequestsPageState extends State { if (difference.inHours < 2) { status = "New"; color = const Color(0XFF1D7AFC); // Blue - } else if (difference.inHours < 48) { - int remaining = 48 - difference.inHours; + } else if (difference.inHours < 240) { + int remaining = 240 - difference.inHours; status = "Expires in ${remaining}h"; if (difference.inHours < 6) { color = const Color(0XFFE56910); // Less urgent @@ -124,7 +124,7 @@ class _OrderRequestsPageState extends State { Navigator.push( context, MaterialPageRoute( - builder: (_) => AcceptOrderRequests(order: order), + builder: (_) => AcceptOrderRequests(order: order,status:cardModel), ), ); }, diff --git a/lib/orders/order_requests_model.dart b/lib/orders/order_requests_model.dart index f43fd95..ec8f328 100644 --- a/lib/orders/order_requests_model.dart +++ b/lib/orders/order_requests_model.dart @@ -15,6 +15,7 @@ class OrderRequestsModel { double lat=0; double lng=0; double distanceInMeters=0; + double distanceInKm=0.0; OrderRequestsModel(); @@ -36,12 +37,13 @@ class OrderRequestsModel { if (parts.length >= 2) { rtvm.displayAddress = parts[parts.length -4]; // "Banjara Hills" } - /* rtvm.distanceInMeters = double.parse((Geolocator.distanceBetween( + rtvm.distanceInMeters = double.parse((Geolocator.distanceBetween( rtvm.lat, rtvm.lng, AppSettings.supplierLatitude, AppSettings.supplierLongitude - ) / 1000).toStringAsFixed(2));*/ + ) / 1000).toStringAsFixed(2)); + rtvm.distanceInKm = double.parse(( rtvm.distanceInMeters / 1000).toStringAsFixed(1)); return rtvm; } diff --git a/lib/orders/search_order_appbar.dart b/lib/orders/search_order_appbar.dart index c2eb385..fd13cdb 100644 --- a/lib/orders/search_order_appbar.dart +++ b/lib/orders/search_order_appbar.dart @@ -20,17 +20,14 @@ class SearchOrderAppBar extends StatelessWidget implements PreferredSizeWidget { scrolledUnderElevation: 0, elevation: 0, leading: GestureDetector( - onTap: () { - Navigator.pop(context); - }, + onTap: onBack, // 👉 Controlled by parent child: Padding( - padding: const EdgeInsets.fromLTRB( - 8, 8, 8, 8), // Add padding if needed + padding: const EdgeInsets.all(8.0), child: Image.asset( 'images/backbutton_appbar.png', height: 24, - width: 24,// Replace with your image path - fit: BoxFit.contain, // Adjust the fit + width: 24, + fit: BoxFit.contain, ), ), ), @@ -40,18 +37,22 @@ class SearchOrderAppBar extends StatelessWidget implements PreferredSizeWidget { decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.circular(22), - border: Border.all(color: Color(0XFF939495)), + border: Border.all(color: const Color(0XFF939495)), ), child: TextField( controller: controller, decoration: InputDecoration( hintText: "Search order", - hintStyle: fontTextStyle(16, Color(0XFF646566), FontWeight.w400), + hintStyle: fontTextStyle( + 16, + const Color(0XFF646566), + FontWeight.w400, + ), prefixIcon: SizedBox( height: 20, width: 20, child: Padding( - padding: const EdgeInsets.all(8.0), // adjust spacing + padding: const EdgeInsets.all(8.0), child: Image.asset( 'images/search.png', fit: BoxFit.contain, @@ -60,29 +61,30 @@ class SearchOrderAppBar extends StatelessWidget implements PreferredSizeWidget { ), border: InputBorder.none, contentPadding: const EdgeInsets.symmetric(vertical: 0), - ), - style: fontTextStyle(16,Color(0XFF2A2A2A),FontWeight.w400), + style: fontTextStyle( + 16, + const Color(0XFF2A2A2A), + FontWeight.w400, + ), + onSubmitted: (value) { + debugPrint("Search Orders: $value"); + }, ), ), - - actions: [ - Padding(padding: EdgeInsets.all(8), - child: - GestureDetector( - onTap: () { - }, - child: Padding( - padding: const EdgeInsets.fromLTRB( - 8, 8, 8, 8), // Add padding if needed + actions: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: GestureDetector( + onTap: onHelp, // 👉 Controlled by parent child: Image.asset( 'images/help_appbar.png', height: 24, - width: 24,// Replace with your image path - fit: BoxFit.contain, // Adjust the fit + width: 24, + fit: BoxFit.contain, ), ), - ),) + ), ], ); } diff --git a/lib/plans/all_plans.dart b/lib/plans/all_plans.dart index 95cca86..185ccb0 100644 --- a/lib/plans/all_plans.dart +++ b/lib/plans/all_plans.dart @@ -5,7 +5,11 @@ import 'package:supplier_new/plans/plans_model.dart'; import 'package:supplier_new/plans/search_plan_appbar.dart'; class AllPlans extends StatefulWidget { - const AllPlans({super.key}); + final String navigationFrom; + AllPlans({ + super.key, + required this.navigationFrom, + }); @override State createState() => _AllPlansState(); @@ -57,13 +61,13 @@ class _AllPlansState extends State { return Scaffold( backgroundColor: const Color(0XFFFFFFFF), - appBar: SearchPlanAppBar( + appBar: widget.navigationFrom.toString().toLowerCase()=='dashboard'?SearchPlanAppBar( controller: searchController, onBack: () => Navigator.pop(context), onHelp: () { print("Help tapped"); }, - ), + ):null, body: SingleChildScrollView( child: Column( children: [ diff --git a/lib/plans/search_plan_appbar.dart b/lib/plans/search_plan_appbar.dart index 6e7f823..d1ea464 100644 --- a/lib/plans/search_plan_appbar.dart +++ b/lib/plans/search_plan_appbar.dart @@ -20,17 +20,14 @@ class SearchPlanAppBar extends StatelessWidget implements PreferredSizeWidget { scrolledUnderElevation: 0, elevation: 0, leading: GestureDetector( - onTap: () { - Navigator.pop(context); - }, + onTap: onBack, // 👉 use callback from parent child: Padding( - padding: const EdgeInsets.fromLTRB( - 8, 8, 8, 8), // Add padding if needed + padding: const EdgeInsets.all(8.0), child: Image.asset( 'images/backbutton_appbar.png', height: 24, - width: 24,// Replace with your image path - fit: BoxFit.contain, // Adjust the fit + width: 24, + fit: BoxFit.contain, ), ), ), @@ -40,18 +37,18 @@ class SearchPlanAppBar extends StatelessWidget implements PreferredSizeWidget { decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.circular(22), - border: Border.all(color: Color(0XFF939495)), + border: Border.all(color: const Color(0XFF939495)), ), child: TextField( controller: controller, decoration: InputDecoration( hintText: "Search Plan", - hintStyle: fontTextStyle(16, Color(0XFF646566), FontWeight.w400), + hintStyle: fontTextStyle(16, const Color(0XFF646566), FontWeight.w400), prefixIcon: SizedBox( height: 20, width: 20, child: Padding( - padding: const EdgeInsets.all(8.0), // adjust spacing + padding: const EdgeInsets.all(8.0), child: Image.asset( 'images/search.png', fit: BoxFit.contain, @@ -60,29 +57,26 @@ class SearchPlanAppBar extends StatelessWidget implements PreferredSizeWidget { ), border: InputBorder.none, contentPadding: const EdgeInsets.symmetric(vertical: 0), - ), - style: fontTextStyle(16,Color(0XFF2A2A2A),FontWeight.w400), + style: fontTextStyle(16, const Color(0XFF2A2A2A), FontWeight.w400), + onSubmitted: (value) { + debugPrint("Search Plan: $value"); + }, ), ), - - actions: [ - Padding(padding: EdgeInsets.all(8), - child: - GestureDetector( - onTap: () { - }, - child: Padding( - padding: const EdgeInsets.fromLTRB( - 8, 8, 8, 8), // Add padding if needed + actions: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: GestureDetector( + onTap: onHelp, // 👉 use callback from parent child: Image.asset( 'images/help_appbar.png', height: 24, - width: 24,// Replace with your image path - fit: BoxFit.contain, // Adjust the fit + width: 24, + fit: BoxFit.contain, ), ), - ),) + ), ], ); } diff --git a/lib/set_rates/set_rates.dart b/lib/set_rates/set_rates.dart index f74cf08..d5b4204 100644 --- a/lib/set_rates/set_rates.dart +++ b/lib/set_rates/set_rates.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:supplier_new/common/settings.dart'; class SetRatesScreen extends StatefulWidget { const SetRatesScreen({super.key}); @@ -11,158 +12,381 @@ class _SetRatesScreenState extends State with SingleTickerProviderStateMixin { late TabController _tabController; - final TextEditingController drinking5000 = TextEditingController(); - final TextEditingController drinking10000 = TextEditingController(); - final TextEditingController drinking15000 = TextEditingController(); - final TextEditingController bore5000 = TextEditingController(); - final TextEditingController bore10000 = TextEditingController(); - final TextEditingController bore15000 = TextEditingController(); + final Map controllers = {}; + // Define categories + tankers + final Map> tankerGroups = {}; + final Map deliveryControllers = {}; + + + /*delivery fee controllers*/ + final TextEditingController pumpFeeController = TextEditingController(); + + final List> data = [ + {"category": "DRINKING WATER", "size": "5,000L", "price": "12"}, + {"category": "DRINKING WATER", "size": "15,000L", "price": "18"}, + {"category": "DRINKING WATER", "size": "20,000L", "price": "20"}, + {"category": "BORE WATER", "size": "5,000L", "price": "10"}, + {"category": "BORE WATER", "size": "10,000L", "price": "14"}, + {"category": "BORE WATER", "size": "15,000L", "price": "16"}, + {"category": "BORE WATER", "size": "25,000L", "price": null}, + ]; @override void initState() { super.initState(); _tabController = TabController(length: 3, vsync: this); - // Prefill values - drinking5000.text = "₹500"; - drinking10000.text = "₹500"; - drinking15000.text = "₹500"; - bore5000.text = "₹500"; - bore10000.text = "₹500"; - bore15000.text = "₹500"; + + // Group data by category and initialize controllers for WaterCharges + for (final item in data) { + final category = item['category'] as String; + final size = item['size'] as String; + final price = item['price']?.toString() ?? ""; // default to empty if null + + if (!tankerGroups.containsKey(category)) { + tankerGroups[category] = []; + } + tankerGroups[category]!.add(size); + + // Pre-fill controller with price or empty + controllers.putIfAbsent("$category-$size", () => TextEditingController(text: price)); + } + + // Initialize controllers for unique capacities for DeliveryFee + final capacities = data.map((item) => item['size'] as String).toSet(); + for (final cap in capacities) { + // Take first price for this capacity, default to empty if null + final price = data.firstWhere( + (d) => d['size'] == cap, + orElse: () => {'price': ''}, + )['price']?.toString() ?? ""; + deliveryControllers.putIfAbsent(cap, () => TextEditingController(text: price)); + } + + } + + @override + void dispose() { + // Dispose all controllers + for (final controller in controllers.values) { + controller.dispose(); + } + for (final controller in deliveryControllers.values) { + controller.dispose(); + } + super.dispose(); } Widget buildTextField(String label, TextEditingController controller) { return Padding( - padding: const EdgeInsets.symmetric(vertical: 8), - child: TextField( - controller: controller, - decoration: InputDecoration( - labelText: label, - labelStyle: const TextStyle(fontSize: 14, color: Colors.black87), - border: OutlineInputBorder( - borderRadius: BorderRadius.circular(8), + padding: const EdgeInsets.symmetric(vertical: 8), + child: TextField( + controller: controller, + cursorColor: primaryColor, + readOnly: false, + keyboardType: TextInputType.number, + decoration: InputDecoration( + counterText: '', + filled: false, + fillColor: Colors.white, + prefixIconConstraints: BoxConstraints( + minWidth: 24, + minHeight: 24, + ), + border: OutlineInputBorder( + borderRadius: BorderRadius.circular(4.0), + borderSide: BorderSide( + color: Color(0XFFC3C4C4), + width: 1, + )), + focusedBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(4.0), + borderSide: BorderSide( + color: Color(0XFF8270DB), + width: 1, + ), + ), + enabledBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(4.0), + borderSide: BorderSide(color: Color(0XFFC3C4C4)), + ), + hintText: label, + hintStyle: fontTextStyle(14, Color(0XFF939495), FontWeight.w400), + /* TextStyle(color: greyColor, fontWeight: FontWeight.bold //<-- SEE HERE + ),*/ ), - ), - keyboardType: TextInputType.number, + style: fontTextStyle(14, Color(0XFF515253), FontWeight.w500), + )); + } + + Widget labelText(String label) { + return Text( + label, + style: fontTextStyle(12, const Color(0XFF515253), FontWeight.w500), + ); + } + + Widget WaterCharges() { + return SingleChildScrollView( + padding: const EdgeInsets.all(16), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + for (final entry in tankerGroups.entries) ...[ + Text( + entry.key, + style: fontTextStyle(10, Color(0XFF2D2E30), FontWeight.w600), + ), + const SizedBox(height: 8), + for (final size in entry.value) + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + labelText("$size (in ₹)*"), + const SizedBox(height: 4), + buildTextField("₹500", controllers["${entry.key}-$size"]!), + const SizedBox(height: 12), + ], + ), + const SizedBox(height: 10), + ], + SizedBox( + width: double.infinity, + child: ElevatedButton( + style: ElevatedButton.styleFrom( + backgroundColor: Color(0XFF8270DB), + foregroundColor: Color(0XFFFFFFFF), + padding: EdgeInsets.symmetric(vertical: 10), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(24), // <-- set your radius here + ), + ), + onPressed: () { + final Map> grouped = {}; + tankerGroups.forEach((category, sizes) { + grouped[category] = {}; + for (final size in sizes) { + grouped[category]![size] = + controllers["$category-$size"]!.text; + } + }); + + ScaffoldMessenger.of(context).showSnackBar( + const SnackBar(content: Text("Rates saved successfully")), + ); + + print(grouped); // Debug: print entered rates + }, + child: Text( + "Save", + style: fontTextStyle(14, const Color(0XFFFFFFFF), FontWeight.w600), + ), + ), + ) + ], ), ); } - @override - Widget build(BuildContext context) { - return SafeArea( - child: Scaffold( - appBar: AppBar( - title: const Text( - "Set Rates", - style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600), + + Widget DeliveryFee() { + // Extract unique capacities + final capacities = data.map((item) => item['size'] as String).toSet().toList(); + + return SingleChildScrollView( + padding: const EdgeInsets.all(16), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + "ADDITIONAL RATES", + style: fontTextStyle(10, const Color(0xFF2D2E30), FontWeight.w600), ), - centerTitle: true, - actions: [ - TextButton( - onPressed: () {}, - child: const Text( - "HELP", - style: TextStyle(color: Colors.blue, fontSize: 14), - ), - ) + SizedBox(height: MediaQuery.of(context).size.height * .004), + Text( + "Add your price per Kilometer for every tanker capacity", + style: fontTextStyle(12, const Color(0xFF939495), FontWeight.w400), + ), + SizedBox(height: MediaQuery.of(context).size.height * .020), + + // 🔹 Dynamic textfields + for (final cap in capacities) ...[ + labelText('$cap tanker (per KM)*'), + SizedBox(height: MediaQuery.of(context).size.height * .004), + buildTextField("+ ₹12", deliveryControllers[cap]!), + const SizedBox(height: 12), ], + + const SizedBox(height: 10), + SizedBox( + width: double.infinity, + child: ElevatedButton( + style: ElevatedButton.styleFrom( + backgroundColor: Color(0XFF8270DB), + foregroundColor: Color(0XFFFFFFFF), + padding: EdgeInsets.symmetric(vertical: 10), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(24), // <-- set your radius here + ), + ), + onPressed: () { + final Map fees = {}; + deliveryControllers.forEach((cap, controller) { + fees[cap] = controller.text; + }); + + ScaffoldMessenger.of(context).showSnackBar( + const SnackBar(content: Text("Rates saved successfully")), + ); + + print(fees); + }, + child: Text( + "Save", + style: fontTextStyle(14, const Color(0XFFFFFFFF), FontWeight.w600), + ), + ), + ) + ], + ), + ); + } + + + Widget PumpFee() { + return SingleChildScrollView( + padding: const EdgeInsets.all(16), + child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + Text( + "TANKER TYPE", + style: fontTextStyle(10, Color(0XFF2D2E30), FontWeight.w600), + ), + SizedBox(height: MediaQuery.of(context).size.height * .004), + Text( + "Add your price addition for tankers with pump", + style: fontTextStyle(12, Color(0XFF939495), FontWeight.w400), ), - body: Column( - children: [ - const SizedBox(height: 16), - const CircleAvatar( - radius: 40, - backgroundColor: Color(0xFFE0E0E0), - child: Icon(Icons.water_drop_outlined, - size: 40, color: Colors.deepPurple), + SizedBox(height: MediaQuery.of(context).size.height * .024), + labelText('Tanker with pump*'), + SizedBox(height: MediaQuery.of(context).size.height * .004), + buildTextField("+ ₹50 ", pumpFeeController), + SizedBox(height: MediaQuery.of(context).size.height * .024), + SizedBox( + width: double.infinity, + child: ElevatedButton( + style: ElevatedButton.styleFrom( + backgroundColor: Color(0XFF8270DB), + foregroundColor: Color(0XFFFFFFFF), + padding: EdgeInsets.symmetric(vertical: 10), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(24), // <-- set your radius here + ), ), - const SizedBox(height: 16), - const Text( - "What’s today’s water price?", - style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600), + onPressed: () { + // Handle save logic + ScaffoldMessenger.of(context).showSnackBar( + const SnackBar(content: Text("Rates saved successfully")), + ); + }, + child: Text( + "Save", + style: fontTextStyle(14, const Color(0XFFFFFFFF), FontWeight.w600), ), - const SizedBox(height: 4), - const Text( - "Set your daily rate so customers know what to expect", - style: TextStyle(fontSize: 13, color: Colors.black54), - textAlign: TextAlign.center, + ), + ) + ]), + ); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: Color(0XFFFFFFFF), + appBar: AppSettings.supplierAppBarWithActionsText('Set Rates', context), + body: Column( + children: [ + Container( + width: double.infinity, + decoration: const BoxDecoration( + color: Color(0XFFF3F1FB), + borderRadius: BorderRadius.only( + bottomLeft: Radius.circular(24), + bottomRight: Radius.circular(24), + ), ), - const SizedBox(height: 20), - TabBar( - controller: _tabController, - labelColor: Colors.black, - unselectedLabelColor: Colors.grey, - indicatorColor: Colors.deepPurple, - tabs: const [ - Tab(text: "Water Type"), - Tab(text: "Delivery Fee"), - Tab(text: "Pump"), + padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 24), + child: Column( + children: [ + SizedBox(height: MediaQuery.of(context).size.height * .096), + const CircleAvatar(radius: 50, backgroundColor: Color(0XFFC9C2F0)), + SizedBox(height: MediaQuery.of(context).size.height * .016), + Text( + "What’s today’s water price?", + style: fontTextStyle(20, Color(0XFF343637), FontWeight.w600), + ), + SizedBox(height: MediaQuery.of(context).size.height * .008), + Text( + "Set your daily rate so customers know what to expect", + style: fontTextStyle(12, Color(0XFF343637), FontWeight.w400), + textAlign: TextAlign.center, + ), ], ), - Expanded( - child: TabBarView( - controller: _tabController, - children: [ - // Water Type Tab - SingleChildScrollView( - padding: const EdgeInsets.all(16), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - const Text( - "DRINKING WATER", - style: TextStyle( - fontWeight: FontWeight.bold, fontSize: 14), - ), - buildTextField("5,000L (in ₹)", drinking5000), - buildTextField("10,000L (in ₹)", drinking10000), - buildTextField("15,000L (in ₹)", drinking15000), - const SizedBox(height: 20), - const Text( - "BORE WATER", - style: TextStyle( - fontWeight: FontWeight.bold, fontSize: 14), + ), + const SizedBox(height: 20), + Container( + height: 30, + margin: const EdgeInsets.symmetric(horizontal: 16, vertical: 8), + child: AnimatedBuilder( + animation: _tabController, + builder: (context, _) { + return TabBar( + controller: _tabController, + indicatorColor: Colors.transparent, // remove underline + dividerColor: Colors.transparent, + isScrollable: false, + overlayColor: MaterialStateProperty.all(Colors.transparent),// equal width + tabs: List.generate(3, (index) { + final labels = ['Water Type', 'Delivery Fee','Pump']; + final isSelected = _tabController.index == index; + + return Container( + decoration: BoxDecoration( + color: isSelected ? const Color(0XFFF1F1F1) : Colors.transparent, + borderRadius: BorderRadius.circular(27), + ), + alignment: Alignment.center, + child: Text( + labels[index], + style: isSelected ?fontTextStyle( + 12, + const Color(0XFF101214), + FontWeight.w600, + ):fontTextStyle( + 12, + const Color(0XFF646464), + FontWeight.w600, ), - buildTextField("5,000L (in ₹)", bore5000), - buildTextField("10,000L (in ₹)", bore10000), - buildTextField("15,000L (in ₹)", bore15000), - const SizedBox(height: 30), - SizedBox( - width: double.infinity, - child: ElevatedButton( - style: ElevatedButton.styleFrom( - backgroundColor: Colors.deepPurple, - padding: const EdgeInsets.symmetric(vertical: 14), - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(10)), - ), - onPressed: () { - // Handle save logic - ScaffoldMessenger.of(context).showSnackBar( - const SnackBar( - content: Text("Rates saved successfully")), - ); - }, - child: const Text( - "Save", - style: - TextStyle(fontSize: 16, color: Colors.white), - ), - ), - ) - ], - ), - ), - // Delivery Fee Tab - const Center(child: Text("Delivery Fee Settings")), - // Pump Tab - const Center(child: Text("Pump Settings")), - ], - ), + ), + ); + }), + ); + }, ), - ], - ), + ), + Expanded( + child: TabBarView( + controller: _tabController, + children: [ + // Water Type Tab + WaterCharges(), + // Delivery Fee Tab + DeliveryFee(), + // Pump Tab + PumpFee() + ], + ), + ), + ], ), ); } diff --git a/pubspec.lock b/pubspec.lock index 6e8bfd5..f390594 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -113,6 +113,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.0.8" + dropdown_button2: + dependency: "direct main" + description: + name: dropdown_button2 + sha256: b0fe8d49a030315e9eef6c7ac84ca964250155a6224d491c1365061bc974a9e1 + url: "https://pub.dev" + source: hosted + version: "2.3.9" fake_async: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 0f33060..ae70739 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -32,6 +32,7 @@ dependencies: geocoding: ^3.0.0 provider: ^6.0.5 google_maps_place_picker_mb: ^3.0.2 + dropdown_button2: ^2.0.0 dev_dependencies: flutter_test: