From 653dd2701823c245c030f09ec478594772ecb233 Mon Sep 17 00:00:00 2001 From: Venba Date: Wed, 10 Jul 2024 08:46:55 +0530 Subject: [PATCH] CHANGE_ --- assets/Template_File.xlsx | Bin 7401 -> 7622 bytes lib/addons.dart | 4649 ++++++++++++++-------------- lib/customAppBar/customAppBar.dart | 20 +- lib/customAppBar/customFooter.dart | 23 + lib/empDetails.dart | 20 +- lib/empReview.dart | 3193 ++++++++++--------- lib/excel_verification.dart | 1305 ++++---- lib/hrDashboard.dart | 693 +++-- lib/hrLogin.dart | 79 +- lib/hrPolicyDetails.dart | 682 ++-- lib/hrVerify.dart | 94 +- lib/phone.dart | 75 +- lib/service/api_service.dart | 46 +- lib/verify.dart | 75 +- pubspec.yaml | 1 + 15 files changed, 5771 insertions(+), 5184 deletions(-) create mode 100644 lib/customAppBar/customFooter.dart diff --git a/assets/Template_File.xlsx b/assets/Template_File.xlsx index c8c892b441e874e807fe1a2e7125d7437c943f0d..e05bfdbaaa8877a65294c0982b705129c5e13b75 100644 GIT binary patch delta 4369 zcmZu#1yoes7N(^KkQrb=(xDqsx^w6d>1IH>L5U%pp#+3MNr*PXYYIW+2^ir@3Z4>iuQ<;Xsco4P-5WY<72p+&b=prU}9g-HNuz= zv2F=hY)R}J0`(4$3GO!gkTPholJO*KK=)j9nm64W{Loo3p|LBZ08pziqrjn?z0v)% zl7YjxI=|1unXO`eoR6aNXVdYji(Eb-E&pOqly8D?7;Pa!G~svgM4C%R<#~!|7a|!msG$WtWMRwgX5e@ za9*h>BZuQkt_B#hb>vlf-+pSG@J|IS?G<&=H|$`HM-ocqS^e|MLCZrNR5C+_EE{JP z+j_(PvFvGt2Z^JW^_-%YYd1YuD4|xE< zUH++z9PceZfz=_BRbO^VSz3ipKBU@^%GjgVa= zy|jGc5N&1ke3Ze^l@7oWmruyu=lm`{ku8pt84^FC8aGy=vC<_NQhui-N`x(~+o-u& zXZ771;skheUDU*>LKKB1)J^!?qC=j#7P*m9yb0wXUMb2^ajJ-Q{CP;?i+6$V!fneU z1x)RDfuF^pFzz1V-uN&zy1sH7`?Ya zXO39Kvq=Q!n?dMmftQr6gc^(}Eqpy0V$*LZnEVprg`b9AIOJit z9<$yvRkt?&OdhvQ(Kl;T-WPUjuNTHfm(Ui+Cee@EIo(MKrxm}Q0cECKC-jp%2WHJ+ zhh^~E-BmPT{@7S4{xJ{LSi*-(;-m}u>dYX~Nrf%LF*H?$lj2$O=fe%x-z*N3Gr4JR zoYs8W%)&{MFk`B1n^u$VZyEKYcQES*&_6K@s@GK~YZC9hPd@Ui8=6nN2$b})+;U#T zvxEd>*#>dVkV}4s)*lQ2lCsWWFvO(MXUtT>Z(65N|Dh9m$1}4&l!kArJmCJb#Z=m_pZ8e zSLgifYH;{xTprh6r$BbQD}n?{s-Lmr$@5pT-tRr!lGYmvszbPVzT;YD8{3$p+aJN* zwd;O3UpCmDOKYp$!N*299*E#zU}OtoVEilapg4(y;fcdgYyq;6-JocQ-=kShX1kiB zY&n2=zEu0GAyzAts>*lc#f3t-%G67<(Ormexzpo}CB=jWQXjd9cCMz{ET;K%E$&+m-(eM>JIF<7Tr-R+4knaxT%m@u7R}u|(kL)$zjgse(RS)T zQV?0)>95{MHG)M-R>T~)o5>W?t3u%?nwryD8uzcBz<5*#1kTiL_@70MQ^;F{8l2D{ z?jp9=0l&B&Y`0|2beG_bvI<~IE7*d%21|l|WX&P5m@uy>T6yYr4bndC;C44?>NFLh zVpCprH{9?2G%(Zbc&^mom2NJ}o2`Bncg26-WwE`FGZf!#KXEFFPI6(HQkf3kd)n9{ ztR=e=oFX}1%Nn^)QK82xhaozE-l2{3cU))AaF9Gx>p{_jmC3s7mU_6l`_|&|Pt(3!%!V>s8RpBc6qClzY|>V;_=f3weW2YY6h|lCBiP^z@TDJEI>Mr)0n$ zTMp#E=oT0ew<~}lvx@2gZ||qPg)FL~80VvVc8}*|?r*q2!l8o2kPq9(ruQBRG zU;LR$TEfIEX&+MsslI|4D9ecKb#Gf4v&3u6C&*+!n&8P0{W03)(H4H>W(?u-Q(f7O zc;fX@uGC7sw23i@{iHI2z&xd;)UvtbosP;BP{{_2HuI+e$HMO*e`w&ka5LupklOSH z+I}%3xny{U*Jeh7{A?er{38}9u-oq6lW2G{KVi9YI47M8ZeDrG{P9;yS;wnueWwen zG&GIq*$GBMCU?oj)RoxEC*hrOXWuJle@<3*xYdh0%(`%Yt;uF-z=JIy1SE`cdS~v@ zS^1@8G@XPmZ^KE&wjWZ#KUIqpE9dR|^Y6tf%;C7SL{v`SyR>TQs-IVK9qo*p1J6#i z64{(P@^&t7lg3xI$iJ(binvzfJMFSw!ST6(pQa)E@ft;J+ zRmayrcs?D-=7|>bE&(Zy8ng+${iOlCg+==LRZPG^t|nmh@*C-(;ezjW{KpBKpy@gu zS&!a)P4$M~@?nSKsXW_vUbfq=`h5Aq%f3uZE>b96$o^bxc$tA<=?FI(D3otzpy2NC z_Otq&)9ddancVLC>5zG->@ZY6cZhP3tulR-D+XUV=UXYy0VS*T1&;9Ha{+XH4$bJ^ zx{(IVIm;~@n$-?1Tb$97s(X4 z1MVme`z@^Gp=jN|YXNcj2iK>3_%8j{S>MdnO&&l2*XHMNF)%(;{>cN^Y2dcv9wCRo zGn4u?yZFhFyAp`ifGuy#98T37JMtts#U)In?N`Gi3PIOwxA;L%d537X`nH)%8u5E= zCM?FzDgi0|=8qDv%$C%4Ces3gn}1|LWid?&dc=oTNLAww^OD#j9e%K*9^)UWaByF+WK?>MR^&vFy z&hKm4B!FLhU-uj>7WSZSAtk3cDpb~(;^y+}G50rpV3MGq^+zf|EiCgR2Lo<6*#M!j zI}df<=%mNAM#EmR-SdoXDxysKe51EhqE{f!Zw1Y^q}!*1>!EVzE0UID>%76bLr(#~ zL!-`xP3h0{)f+UmVvb$bk1V#`eixrGtTWtze(9}VrHzS!F?x}$o5Mf}{ z$lay9ZHQ1tl>BgQQ?OM{ztp^LI?QRXs zgpRk8a}Y`}h%y@Lx$6{eKrEVtRvhFNWy_RgqDiyIBwC=U_sezm^1%cH?w{g>Dbo4V za$^M&Ez4){97`q3$dXMTl@|8MJ+@Yzq2j@e_{gvfCgy<`=QIj=udYPKCF8!~UNw09 zLAHZmUpt&1e8)UQ%NV-x?;Cy`)PA z6&pD5*wx}<$qGZj>~u~tNKckS@cjI`S`s4If9EuTR;fvvMMwSoM6#o8!4D}vS6ptR z)!u{aP}m56fJS2fX0h^6RBWmv8kK1T#Fz^fH0v4Yzj-ZrnlArd#4w(y>3!a5>X~2u zG>QE)ceQg`3WPmNEMAZuuK2>mhwX>kWtxpnCT`MFp=nly1k=;*dL6ImyQCQe&+u*x zQyf)S>UeFKIjsL<7!)pu5$@E*PmJ6>19tpM7a=gwjb5%6@a1%lDBlK2m^_s{N9-j1 zS{!vTnmzPR{1vS{t~Oa?FoPNRYSO!y6PgsdWS~;B^~wG!nNJ7AEELA!lr67}@1ViZ z7tuf(m_$~sz@H<3Mm=1q+YOSB_5a9Rkn)4gWvTqOC~{zhLJOR z`r+mhdH6(LAqWSxju9?!?grE6ps*YF-B3xG* zB90G1b0Cc|(2+IE@B@IwAk2ZjrX`dqXdheRd!cEox^7e}>j}Ltvm2jlQH5gKcZt0z zmJ=BF1?~+z+=opBnjB4VxU#FmM`LDx%qEWn!BGh29+xanAiuAgV zH~e1-j>-Y^Fx)))yB1~n)DI-LDA+$c~8 zTISpDD5a$p$Gm=P;c4gW#m9Sd*H**CqQv;~6T7g*yd`_o%MG)nG^?N~Vk z>BvLmTY1wBoD+>)3Y(&|%emJ)gW>?9_!>Opis4K8)0$_5s0hp7Xjpjf4faJ5+KL`d z84dUg1+2VC`K)H4OBYz%S-PNaB2tCydG%{6t3w3MP}m({4{ok1kkV@aUv2rCGF4c6 zg>jaj$0}Pb(3NE_sOt1l(7^_H*~g1rgh8Qmy}6y zl%`~weY;$XO0GtBeV2TC?WOqlGU2-)&SI$=|UR0Qqv~0@N}#8BN>}acY}K;(9i{&Rz*s{ zcsELMk1x%Dor|wRebi+$h`#fCYOYpyGs``Y2dzN4E|}dw;67QDI*yYy8P7&S^Y$7j zlQjK}GYVq6U7$weXf$oG%=3_zmCCIcaDisFB}(Y#e{O>BI3AZ|#Fw74uIdBiCN=a! z686~fJ+AFFaVqd4xF>#>qANC&bSd(YN?cl@wE_GE;o{E>avWMWQQx8}5ImvJ?Y~bC zc7Q!e4U~>pI%u{O#dJROMg|L%HzePL7ns}kquQ2j`LrL7078D5KhTOZ`6jP;Bm0Q| z5%1XK+7b&^`%@*K&X|cVmQi|DsZ+wHI!@~6q^J!!lTv4#hz%wC=ttQ%>XROt5gNy@ zCu$4Z?VhRII7J?8i;YfJs0&TJ7aASw>j&Y62j`E>j|4k-EokAyg#BDUe1W+x)lN?8 zlc=$+n;(DaP9D3V!?yi!tzB3>;^FwJbMi!gipfs_@LS3oOv6VEI2YxU_}JCqvAv62 zLzhT9&Ahbf3s=JN6r%Rx1iEDHghv)!(=|k?530Qgg%jj7DuUuS!|NW^7TatmZ>|=n zaf*F95(M0>C{(*8o&bFy7H#AA1!+Hxz@Uap-c5FsS8}QsRBp+1BxBrIV&^b5YhC`23 z{`rS?a;MboW8o^3Hpr79^htQ_dKtASR>2nsem+Q$+EVx4L@9`)6M=nF{78aeQOBAh zc4lsJdB;-u#mMaJazOA1jL)U(@m3=Cf*kZh{aDYjc>6-WVy3pHcmG7)s5yyx7hhY8 z)%wZ!e1;Iql0lW^g=yM3u@-`uWbh;zPk{gc0Ehtq|3V-PJ4gZ*U#SXdh2XtZhf0e~ouB=}$Zp zy#Ls2aJl%;U<3d#PUOreW9?};ZNQxQ{H{_?^{!wGsm90~`M_j)qBT#uxe#1C#HKGP zG33X_@f!6#Pf=(=+mq{x0{-WX?ihc{#n?gEp7?82XA+7JK{S#m z4~X<0YQQKKgk{OpmHFp{S@yp?E&G*e^E1k}k6M2u?kO^!U|&VSsod7@lX*vq`+Fk& znj<)Oc3Ku%XnkiliE9yAR<~(e^1fipPm1iW;GGAxau?Ar6g9WMjxLqoSbg`vbp zE8pQfao23qx^|y0|3sg-t*eJOoSO+tf%TY+j+xfL-URCQcxa3_~xm|MYmleJHr=LmFVD-=W ztd5UwNr;)EMB<#7NyA&OCG_EMM)(GcBlEq7LP!(bUg~yRN^Z9(Ef6M@o0iYpbAS5c z9m@BuN^ToM!g%~5`TQBV2;FaEm6Uv=x2J|9kNCK5;4Hb72z%U3powGYFyHK-;LHS_ z-=%TPS?u9ed1|d@pY`#4je8oCHYF2wHAS~nf@@NcD4fldDt9#35?}OJGdBlVShP)3 zJj;uedoDs!6$!6^by0bcDjN%Iw`_mB@~DWtbF6d8&|Qd+wr6xB|C%!0vo31jxk{+> z{?T)SFG(vesY3UGk{|<9jW*Y^hk8csJi%}`@B?Po4}(-SRQ5#i(&4Y8;d85NHB^=U z?YYslDBysc<0;ZZGy}6^X!Sl2WntlhvfB zr6W-0V~)p09=sVjMqp=u$;B|?*-T^Prs^SaPZ?(19fUB!YP$AQ_IP;T6ezfGu0w#_ zD;Yf2*Ltm33dEyw2bf}Fq=yFSr=+1-`6mmg5kpnqT1di09VFq*Y0YLA6Z*Odi(ZoV zl@41GkTRjj^3LWdeT!Cd%cAj)XL*N?nX#=fr*K{U<(0IlAIu*TK+6MNTW!Y?1w%vE zN7cN($(}}PL`yAgsKJ{wYOoPWtTd|3;%*l5n#vl(b_=f>5t6SAh0Q@oI3|Fi*1C z;vJHeD795-2kuB)3JSsYh3tmZlv>opt-+_62kqrs@>{l}?!UA1Yv+x4>^Ii)n#U-- zL8}QgPxWF$XqxOy+>~>5177p`Nf+(062=dJ7h3>p!cMKGCs+6C*i&A=uM+`IW`$ah+cMo=qHJs~m zW1x5DD}LoPADCZ(ZrnVzpbQ}Zpb!2J=whBz!%)!}jr(oFxS$y*Q2gozFPF&JL%!c&bZFw|1BbwelDW}5GOH9JjK4KUzEK&iQw0yZ zWut5hM*=H29A_Mq_*S|&m~g)t%g<-KRdnO95v=iq6hq2e-k`i3Egj#3!UMtAHC zZ`b!39(?q>x9(Hm9iX*i!1i7aX~8pOl%?S1`rKm*-li_sLm3%5-jILXZ%6Tj>-tok z|60rGGP1MD%pZ8=#S56|8OLSW;=3%_|0>s&l(bxbItGjcoiK{b5Mt3IzTW}kwi0g~ zbL+xtrB^d=&ly{k6(OG2uV#KZfN}rMn9BH6qB9mp6Vlyyydtkd(XHXAXa!^uH z+t8Co$K(!+HmRj?mFWI>Yed@nbSOrGI$by|FH0oBqGXa1f|V-9^ubJfx-}Cv%orQiNMp&VxPD*5eF1c2AHiR9CC!r-h9vHREy#o92@y0ms zwKHMQvu=u4t>$sO>;Zep3+6k1Z6Z%}zgF5?EK-YWo1h?mZSkk^WwizQQ`4cVY%?cg zY-!qOe9qW`&g=etc_vU?SJKSq2kyORG7mS=YE&Uyl&ZAmQQ}PGNpvjU7sq=xB05>F zbJbs)Pyn$-q*z(`d;wZSE);d!=KQizBPJPtXPxeN8HXAC|HR=Bg}^M*v!YyDuk!hX zPPe^Et!Vt6lH*W;BhTxtp}bkFfGfN9ejb;~j~xbi;HRH9Cso&{g-o{(Q@5IlZ8aiS zYUP<2E#HV{(EEGr_ykvg>*AlkCo*~#7?`{n6yUqje2Tq^Uw91Fw1 zIQFNZ-C?Z%|AfUsRQ@!!hY;yMvncaz%F9OA;D6K<6TmFUcD3|3bL0Gnsa*+B5JngT z!~9?-XT4JV8*MI$++RZ;!_30-=di!;6763a06+^B#)^f*@amw@bn*1<%a5Nf0}c9@ z5{w1_Fn6Zygm!>0xO)4&`2ogq~J+K8mZ%(Afl`339B|9R;W7ylXubQl)s i^*{cQgEHd_GGL6L?0;SZpv-uLm~<#NQ47=6hW`V32Vda; diff --git a/lib/addons.dart b/lib/addons.dart index afc3525..2c861f2 100644 --- a/lib/addons.dart +++ b/lib/addons.dart @@ -15,6 +15,8 @@ import 'dart:convert'; import 'package:intl/intl.dart'; import 'package:url_launcher/url_launcher.dart'; +import 'customAppBar/customFooter.dart'; + class addOnsDetails extends StatefulWidget { const addOnsDetails({Key? key}) : super(key: key); @@ -24,6 +26,7 @@ class addOnsDetails extends StatefulWidget { class _addOnsDetailsState extends State { late ApiService apiService; + bool isLoading = true; bool isChecked = false; bool _addOnsDependentSwitcher = false; // Declare the _isSwitched variable here @@ -129,6 +132,11 @@ class _addOnsDetailsState extends State { _memberNameController = TextEditingController(); _relationShipController = TextEditingController(); _loadToken(); + Future.delayed(Duration(seconds: 5), () { + setState(() { + isLoading = false; + }); + }); } @override @@ -1685,1614 +1693,150 @@ class _addOnsDetailsState extends State { } return Scaffold( - appBar: CustomAppBar(), - body: SingleChildScrollView( - child: Container( - padding: Responsive.isDesktop(context) - ? EdgeInsets.symmetric( - horizontal: MediaQuery.of(context).size.width * - 0.2, // 30% of screen width as horizontal padding - vertical: MediaQuery.of(context).size.height * - 0.03, // 5% of screen height as vertical padding - ) - : EdgeInsets.all(10), - color: Color(0xFFEFF3F6), - child: Column( - children: [ - Card( - elevation: 0, - child: Container( - width: double.infinity, - height: 75, - padding: Responsive.isDesktop(context) - ? EdgeInsets.only( - top: 20, bottom: 20, left: 30, right: 30) - : EdgeInsets.only( - top: 12, - bottom: 12, - left: 10, - right: 10), // Add padding to the container - child: Row( - children: [ - Expanded( - flex: 6, - child: Container( - width: 150, - height: 150, - alignment: Alignment.centerLeft, - child: Image.network( - clientLogo ?? '', - width: 80, // Set the width here - height: 80, // Set the height here - loadingBuilder: (BuildContext context, - Widget child, - ImageChunkEvent? loadingProgress) { - if (loadingProgress == null) return child; - return Center( - child: CircularProgressIndicator( - value: loadingProgress.expectedTotalBytes != - null - ? loadingProgress - .cumulativeBytesLoaded / - loadingProgress.expectedTotalBytes! - : null, - ), - ); - }, - errorBuilder: (BuildContext context, Object error, - StackTrace? stackTrace) { - return Image.asset( - 'assets/Solid_gray.png', // Replace 'default_image.png' with your default image asset path - width: 80, - height: 80, - fit: BoxFit.cover, - ); - }, - ), - ), - ), - Expanded( - flex: 9, - child: Text( - clientName ?? '', - textAlign: TextAlign.right, - style: GoogleFonts.poppins( - fontSize: Responsive.isDesktop(context) ? 20 : 18, - fontWeight: FontWeight.w600, - ), - ), - ) - ], - ), - ), - ), - SizedBox(height: 16), - if (gpaPolicies != null && gpaPolicies.length > 0) - Card( + appBar: CustomAppBar(), + body: Stack(children: [ + SingleChildScrollView( + child: Container( + padding: Responsive.isDesktop(context) + ? EdgeInsets.symmetric( + horizontal: MediaQuery.of(context).size.width * + 0.2, // 30% of screen width as horizontal padding + vertical: MediaQuery.of(context).size.height * + 0.03, // 5% of screen height as vertical padding + ) + : EdgeInsets.all(10), + color: Color(0xFFEFF3F6), + child: Column( + children: [ + Card( elevation: 0, - child: Padding( + color: Colors.white, + child: Container( + width: double.infinity, + height: 75, padding: Responsive.isDesktop(context) - ? EdgeInsets.all(30) - : EdgeInsets.all(10), - child: Column( + ? EdgeInsets.only( + top: 20, bottom: 20, left: 30, right: 30) + : EdgeInsets.only( + top: 12, + bottom: 12, + left: 10, + right: 10), // Add padding to the container + child: Row( children: [ - Container( - decoration: BoxDecoration( - color: Color( - 0xFFFFF1DD), // Set background color for the container - borderRadius: BorderRadius.circular( - 5), // Set border radius for the container + Expanded( + flex: 6, + child: Container( + width: 150, + height: 150, + alignment: Alignment.centerLeft, + child: Image.network( + clientLogo ?? '', + width: 80, // Set the width here + height: 80, // Set the height here + loadingBuilder: (BuildContext context, + Widget child, + ImageChunkEvent? loadingProgress) { + if (loadingProgress == null) return child; + return Center( + child: CircularProgressIndicator( + value: loadingProgress + .expectedTotalBytes != + null + ? loadingProgress + .cumulativeBytesLoaded / + loadingProgress + .expectedTotalBytes! + : null, + ), + ); + }, + errorBuilder: (BuildContext context, + Object error, StackTrace? stackTrace) { + return Image.asset( + 'assets/Solid_gray.png', // Replace 'default_image.png' with your default image asset path + width: 80, + height: 80, + fit: BoxFit.cover, + ); + }, + ), ), - padding: Responsive.isDesktop(context) - ? EdgeInsets.only( - top: 15, bottom: 15, left: 25, right: 25) - : EdgeInsets.only( - top: 10, bottom: 10, left: 10, right: 10), - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Expanded( - flex: 8, - child: Container( - alignment: Alignment.centerLeft, - child: Column( - mainAxisAlignment: - MainAxisAlignment.start, - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Text( - gpaPolicyName ?? '', - textAlign: TextAlign.left, - style: GoogleFonts.poppins( - fontSize: - Responsive.isDesktop( - context) - ? 18 - : 14, - ), - ), - Row( + ), + Expanded( + flex: 9, + child: Text( + clientName ?? '', + textAlign: TextAlign.right, + style: GoogleFonts.poppins( + fontSize: + Responsive.isDesktop(context) ? 20 : 18, + fontWeight: FontWeight.w600, + ), + ), + ) + ], + ), + ), + ), + SizedBox(height: 16), + if (gpaPolicies != null && gpaPolicies.length > 0) + Card( + elevation: 0, + color: Colors.white, + child: Padding( + padding: Responsive.isDesktop(context) + ? EdgeInsets.all(30) + : EdgeInsets.all(10), + child: Column( + children: [ + Container( + decoration: BoxDecoration( + color: Color( + 0xFFFFF1DD), // Set background color for the container + borderRadius: BorderRadius.circular( + 5), // Set border radius for the container + ), + padding: Responsive.isDesktop(context) + ? EdgeInsets.only( + top: 15, + bottom: 15, + left: 25, + right: 25) + : EdgeInsets.only( + top: 10, + bottom: 10, + left: 10, + right: 10), + child: Row( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Expanded( + flex: 8, + child: Container( + alignment: Alignment.centerLeft, + child: Column( + mainAxisAlignment: + MainAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, children: [ Text( - 'Group Personal Accident Coverage', + gpaPolicyName ?? '', textAlign: TextAlign.left, style: GoogleFonts.poppins( fontSize: Responsive.isDesktop( context) - ? 20 - : 16, - fontWeight: - FontWeight.w600, - ), - ), - if (gpaECardDownload != null) - GestureDetector( - onTap: () async { - // Convert the URL string to a Uri object - Uri uri = Uri.parse( - gpaECardDownload); - - // Check if the URL is valid - if (await canLaunchUrl( - uri)) { - // Open the URL in the default browser - await launchUrl(uri); - } else { - // Handle the case where the URL cannot be launched - print( - 'Could not launch $gpaECardDownload'); - } - }, - child: MouseRegion( - cursor: - SystemMouseCursors - .click, - child: Icon( - Icons.file_download, - color: - Color(0xFFE26728), - size: 25, - ), - ), - ), - ], - ), - ], - ))), - Expanded( - flex: 4, - child: Container( - alignment: Alignment.centerRight, - child: Column( - mainAxisAlignment: - MainAxisAlignment.end, - crossAxisAlignment: - CrossAxisAlignment.end, - children: [ - Text( - 'Sum Insured', - textAlign: TextAlign.right, - style: GoogleFonts.poppins( - fontSize: - Responsive.isDesktop( - context) - ? 18 - : 14, - ), - ), - Text( - '₹ ${gpasumInsured != null ? gpasumInsured : 'NA'}', - textAlign: TextAlign.right, - style: GoogleFonts.poppins( - fontSize: - Responsive.isDesktop( - context) - ? 20 - : 16, - fontWeight: FontWeight.w600, - ), - ), - ], - ))), - ], - ), - ), - SizedBox(height: 15), - Container( - padding: Responsive.isDesktop(context) - ? EdgeInsets.only( - top: 0, bottom: 0, left: 15, right: 15) - : EdgeInsets.only( - top: 0, bottom: 0, left: 5, right: 5), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Icon(Icons.arrow_right, - color: - Color(0xFFE26728)), // Arrow icon - SizedBox( - width: Responsive.isDesktop(context) - ? 10 - : 5), // Space between icon and text - Expanded( - child: Text( - gpaSelfDetails ?? '', - style: GoogleFonts.poppins( - fontSize: - Responsive.isDesktop(context) - ? 18 - : 16, - color: Color(0xFF232526), - ), - ), - ), - ], - ), - ], - ), - ), - ], - ), - )), - SizedBox(height: 16), - if (gmcPolicies != null && gmcPolicies.length > 0) - Column( - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - ...generateGmcCards(gmcPolicies), - ], - ), - SizedBox(height: 16), - if (addOnsDependentMappedFamilyFloatersDependent != null || - topUpMappedFamilyFloatersSi != null) - Card( - elevation: 0, - child: Padding( - padding: Responsive.isDesktop(context) - ? EdgeInsets.all(30) - : EdgeInsets.all(10), - child: Column( - children: [ - Container( - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Expanded( - flex: 12, - child: Container( - alignment: Alignment.centerLeft, - child: Column( - mainAxisAlignment: - MainAxisAlignment.start, - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Text( - 'Add Ons', - textAlign: TextAlign.left, - style: GoogleFonts.poppins( - fontSize: - Responsive.isDesktop( - context) - ? 20 - : 18, - fontWeight: FontWeight.w600, - color: Color(0xFF181818)), - ), - Text( - 'Increase your medical cover for your family or add parents or parent in laws by paying additional premium', - textAlign: TextAlign.left, - style: GoogleFonts.poppins( - fontSize: - Responsive.isDesktop( - context) - ? 18 - : 15, - color: Color(0xFF181818), - ), - ), - ], - ))), - ], - ), - ), - SizedBox(height: 15), - if (topUpMappedFamilyFloatersSi != null) - Container( - decoration: BoxDecoration( - color: Color( - 0xFFDDF3FF), // Set background color for the container - borderRadius: BorderRadius.circular( - 5), // Set border radius for the container - ), - padding: Responsive.isDesktop(context) - ? EdgeInsets.all(25) - : EdgeInsets.all(10), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Expanded( - flex: Responsive.isDesktop(context) - ? 6 - : 8, - child: Container( - alignment: Alignment.centerLeft, - child: Column( - mainAxisAlignment: - MainAxisAlignment.start, - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Text( - topUpPolicyName ?? '', - textAlign: TextAlign.left, - style: - GoogleFonts.poppins( - fontSize: Responsive - .isDesktop( - context) - ? 18 - : 14, - ), - ), - Text( - topUpTypeName ?? '', - textAlign: TextAlign.left, - style: - GoogleFonts.poppins( - fontSize: Responsive - .isDesktop( - context) - ? 20 - : 16, - fontWeight: - FontWeight.w600, - ), - ), - ], - ))), - if (Responsive.isDesktop(context) && - _topUpSiSwitcher == true) - Expanded( - flex: 3, - child: Container( - width: 50, - alignment: Alignment.center, - child: Column( - mainAxisAlignment: - MainAxisAlignment - .center, - crossAxisAlignment: - CrossAxisAlignment - .center, - children: [ - IgnorePointer( - ignoring: (topUpOpenForEnrollment == - 0 || - (topUpOpenForEnrollment != - 0 && - topUpECardDownload != - null)), - child: - DropdownButtonFormField< - String>( - onChanged: (value) { - setState(() { - topUpSiSelectedSI = - value; - }); - topUpSiCalculation( - value); - // calculationForTopUpSiSumValue( - // 'Edit'); - }, - decoration: - InputDecoration( - border: - OutlineInputBorder(), - hintText: - 'Sum Insured', - labelText: - 'Sum Insured', - contentPadding: - EdgeInsets - .symmetric( - vertical: - 5, - horizontal: - 5), - ), - value: - topUpSiSelectedSI, - items: (topUpSlabRates ?? - []) - .map< - DropdownMenuItem< - String>>( - (addOn) { - return DropdownMenuItem< - String>( - value: addOn['si'] - .toString(), - child: Text( - '₹ ${addOn['si']}'), - ); - }).toList(), - ), - ) - ], - ))), - Expanded( - flex: 3, - child: Container( - alignment: - Alignment.centerRight, - child: Column( - mainAxisAlignment: - MainAxisAlignment.end, - crossAxisAlignment: - CrossAxisAlignment.end, - children: [ - Switch( - value: _topUpSiSwitcher, - onChanged: (topUpOpenForEnrollment == - 0 || - (topUpOpenForEnrollment != - 0 && - topUpECardDownload != - null)) - ? null - : (value) { - setState(() { - _topUpSiSwitcher = - value; - // Add your logic here based on the toggle state - }); - }, - activeColor: Color( - 0xFFE26728), // Color when the switch is ON - inactiveTrackColor: Colors - .grey, // Color of the switch track when OFF - ), - ], - ))), - ], - ), - if (_topUpSiSwitcher == true) - SizedBox(height: 10), - if (!Responsive.isDesktop(context) && - _topUpSiSwitcher == true) - Row( - children: [ - Expanded( - flex: 12, - child: Container( - width: 50, - alignment: Alignment.center, - child: Column( - mainAxisAlignment: - MainAxisAlignment - .center, - crossAxisAlignment: - CrossAxisAlignment - .center, - children: [ - IgnorePointer( - ignoring: (topUpOpenForEnrollment == - 0 || - (topUpOpenForEnrollment != - 0 && - topUpECardDownload != - null)), - child: - DropdownButtonFormField< - String>( - onChanged: (value) { - setState(() { - topUpSiSelectedSI = - value; - }); - topUpSiCalculation( - value); - // calculationForTopUpSiSumValue( - // 'Edit'); - }, - decoration: - InputDecoration( - border: - OutlineInputBorder(), - hintText: - 'Sum Insured', - labelText: - 'Sum Insured', - contentPadding: - EdgeInsets - .symmetric( - vertical: - 5, - horizontal: - 5), - ), - value: - topUpSiSelectedSI, - items: (topUpSlabRates ?? - []) - .map< - DropdownMenuItem< - String>>( - (addOn) { - return DropdownMenuItem< - String>( - value: addOn['si'] - .toString(), - child: Text( - '₹ ${addOn['si']}'), - ); - }).toList(), - ), - ) - ], - ))), - ], - ), - if (_topUpSiSwitcher == true) - SizedBox(height: 10), - if (_topUpSiSwitcher == - true) // Add space between rows - Row( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Expanded( - flex: 12, - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: - topUpMappedFamilyFloatersSi - .where((item) => - item[ - 'is_value_exist'] == - true) - .map((item) { - Map data = - item['data']; - String formattedDate = - formatDate(data['dob']); - return Row( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Icon(Icons.arrow_right, - color: Color( - 0xFFE26728)), // Arrow icon - SizedBox( - width: Responsive - .isDesktop( - context) - ? 10 - : 5), // Space between icon and text - Expanded( - child: Text( - '${data['name']} ~ ${data['relationship']} ~ DOB : $formattedDate', - style: - GoogleFonts.poppins( - fontSize: Responsive - .isDesktop( - context) - ? 18 - : 16, - color: - Color(0xFF232526), - ), - ), - ), - ], - ); - }).toList(), - ), - ) - ], - ), - if (_topUpSiSwitcher == true) - SizedBox(height: 20), - if (Responsive.isDesktop(context) && - _topUpSiSwitcher == true) - Row( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Expanded( - flex: 5, - child: Container( - alignment: Alignment.center, - child: Column( - mainAxisAlignment: - MainAxisAlignment - .center, - crossAxisAlignment: - CrossAxisAlignment - .center, - children: [ - Text( - 'Additional Premium', - textAlign: - TextAlign.start, - style: - GoogleFonts.poppins( - fontSize: 20, - fontWeight: - FontWeight.w500, - ), - ), - Text( - topUpSiPremiumValue != - null - ? '₹ $topUpSiPremiumValue/Year' - : 'N/A', - textAlign: - TextAlign.start, - style: - GoogleFonts.poppins( - fontSize: 18, - ), - ), - ], - ))), - Expanded( - flex: 2, - child: Container( - alignment: Alignment.center, - child: Column( - mainAxisAlignment: - MainAxisAlignment - .center, - crossAxisAlignment: - CrossAxisAlignment - .center, - children: [ - Text( - 'GST', - textAlign: - TextAlign.start, - style: - GoogleFonts.poppins( - fontSize: 20, - fontWeight: - FontWeight.w500, - ), - ), - Text( - topUpSiPremiumGst != - null - ? '₹ $topUpSiPremiumGst/-' - : 'N/A', - textAlign: - TextAlign.start, - style: - GoogleFonts.poppins( - fontSize: 18, - ), - ), - ], - ))), - Expanded( - flex: 5, - child: Container( - alignment: Alignment.center, - child: Column( - mainAxisAlignment: - MainAxisAlignment - .center, - crossAxisAlignment: - CrossAxisAlignment - .center, - children: [ - Text( - 'Total Payable', - textAlign: - TextAlign.start, - style: - GoogleFonts.poppins( - fontSize: 20, - fontWeight: - FontWeight.w500, - ), - ), - Text( - topUpSiTotalAmt != null - ? '₹ $topUpSiTotalAmt/-' - : 'N/A', - textAlign: - TextAlign.start, - style: - GoogleFonts.poppins( - fontSize: 18, - ), - ), - ], - ))), - ], - ), - if (!Responsive.isDesktop(context) && - _topUpSiSwitcher == true) - Container( - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Row( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Expanded( - flex: 6, - child: Container( - alignment: Alignment - .centerLeft, - child: Column( - mainAxisAlignment: - MainAxisAlignment - .center, - crossAxisAlignment: - CrossAxisAlignment - .center, - children: [ - Text( - 'Additional Premium', - textAlign: - TextAlign - .start, - style: GoogleFonts - .poppins( - fontSize: 18, - fontWeight: - FontWeight - .w500, - ), - ), - ], - ))), - Expanded( - flex: 6, - child: Container( - alignment: Alignment - .centerRight, - child: Column( - mainAxisAlignment: - MainAxisAlignment - .center, - crossAxisAlignment: - CrossAxisAlignment - .center, - children: [ - Text( - topUpSiPremiumValue != - null - ? '₹ $topUpSiPremiumValue/Year' - : 'N/A', - textAlign: - TextAlign - .start, - style: GoogleFonts - .poppins( - fontSize: 16, - ), - ), - ], - ))), - ], - ), - Row( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Expanded( - flex: 6, - child: Container( - alignment: Alignment - .centerLeft, - child: Column( - mainAxisAlignment: - MainAxisAlignment - .center, - crossAxisAlignment: - CrossAxisAlignment - .center, - children: [ - Text( - 'GST', - textAlign: - TextAlign - .start, - style: GoogleFonts - .poppins( - fontSize: 18, - fontWeight: - FontWeight - .w500, - ), - ), - ], - ))), - Expanded( - flex: 6, - child: Container( - alignment: Alignment - .centerRight, - child: Column( - mainAxisAlignment: - MainAxisAlignment - .center, - crossAxisAlignment: - CrossAxisAlignment - .center, - children: [ - Text( - topUpSiPremiumGst != - null - ? '₹ $topUpSiPremiumGst/-' - : 'N/A', - textAlign: - TextAlign - .start, - style: GoogleFonts - .poppins( - fontSize: 16, - ), - ), - ], - ))), - ], - ), - Row( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Expanded( - flex: 6, - child: Container( - alignment: Alignment - .centerLeft, - child: Column( - mainAxisAlignment: - MainAxisAlignment - .center, - crossAxisAlignment: - CrossAxisAlignment - .center, - children: [ - Text( - 'Total Payable', - textAlign: - TextAlign - .start, - style: GoogleFonts - .poppins( - fontSize: 18, - fontWeight: - FontWeight - .w500, - ), - ), - ], - ))), - Expanded( - flex: 5, - child: Container( - alignment: Alignment - .centerRight, - child: Column( - mainAxisAlignment: - MainAxisAlignment - .center, - crossAxisAlignment: - CrossAxisAlignment - .center, - children: [ - Text( - topUpSiTotalAmt != - null - ? '₹ $topUpSiTotalAmt/-' - : 'N/A', - textAlign: - TextAlign - .start, - style: GoogleFonts - .poppins( - fontSize: 16, - ), - ), - ], - ))), - ], - ), - ])) - ], - ), - ), - SizedBox(height: 15), - if (topUpParentMappedFamilyFloatersSi != null) - Container( - decoration: BoxDecoration( - color: Color( - 0xFFDDF3FF), // Set background color for the container - borderRadius: BorderRadius.circular( - 5), // Set border radius for the container - ), - padding: Responsive.isDesktop(context) - ? EdgeInsets.all(25) - : EdgeInsets.all(10), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Expanded( - flex: Responsive.isDesktop(context) - ? 6 - : 8, - child: Container( - alignment: Alignment.centerLeft, - child: Column( - mainAxisAlignment: - MainAxisAlignment.start, - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Text( - topUpParentPolicyName ?? - '', - textAlign: TextAlign.left, - style: - GoogleFonts.poppins( - fontSize: Responsive - .isDesktop( - context) - ? 18 - : 14, - ), - ), - Text( - topUpParentTypeName ?? '', - textAlign: TextAlign.left, - style: - GoogleFonts.poppins( - fontSize: Responsive - .isDesktop( - context) - ? 20 - : 16, - fontWeight: - FontWeight.w600, - ), - ), - ], - ))), - if (Responsive.isDesktop(context) && - _topUpParentSiSwitcher == true) - Expanded( - flex: 3, - child: Container( - width: 50, - alignment: Alignment.center, - child: Column( - mainAxisAlignment: - MainAxisAlignment - .center, - crossAxisAlignment: - CrossAxisAlignment - .center, - children: [ - IgnorePointer( - ignoring: (topUpParentOpenForEnrollment == - 0 || - (topUpParentOpenForEnrollment != - 0 && - topUpParentECardDownload != - null)), - child: - DropdownButtonFormField< - String>( - onChanged: (value) { - setState(() { - topUpParentSiSelectedSI = - value; - }); - topUpParentSiCalculation( - value); - // calculationForTopUpSiSumValue( - // 'Edit'); - }, - decoration: - InputDecoration( - border: - OutlineInputBorder(), - hintText: - 'Sum Insured', - labelText: - 'Sum Insured', - contentPadding: - EdgeInsets - .symmetric( - vertical: - 5, - horizontal: - 5), - ), - value: - topUpParentSiSelectedSI, - items: (topUpParentSlabRates ?? - []) - .map< - DropdownMenuItem< - String>>( - (addOn) { - return DropdownMenuItem< - String>( - value: addOn['si'] - .toString(), - child: Text( - '₹ ${addOn['si']}'), - ); - }).toList(), - ), - ) - ], - ))), - Expanded( - flex: 3, - child: Container( - alignment: - Alignment.centerRight, - child: Column( - mainAxisAlignment: - MainAxisAlignment.end, - crossAxisAlignment: - CrossAxisAlignment.end, - children: [ - Switch( - value: - _topUpParentSiSwitcher, - onChanged: (topUpParentOpenForEnrollment == - 0 || - (topUpParentOpenForEnrollment != - 0 && - topUpParentECardDownload != - null)) - ? null - : (value) { - setState(() { - _topUpParentSiSwitcher = - value; - // Add your logic here based on the toggle state - }); - }, - activeColor: Color( - 0xFFE26728), // Color when the switch is ON - inactiveTrackColor: Colors - .grey, // Color of the switch track when OFF - ), - ], - ))), - ], - ), - if (_topUpParentSiSwitcher == true) - SizedBox(height: 10), - if (!Responsive.isDesktop(context) && - _topUpParentSiSwitcher == true) - Row( - children: [ - Expanded( - flex: 12, - child: Container( - width: 50, - alignment: Alignment.center, - child: Column( - mainAxisAlignment: - MainAxisAlignment - .center, - crossAxisAlignment: - CrossAxisAlignment - .center, - children: [ - IgnorePointer( - ignoring: (topUpParentOpenForEnrollment == - 0 || - (topUpParentOpenForEnrollment != - 0 && - topUpParentECardDownload != - null)), - child: - DropdownButtonFormField< - String>( - onChanged: (value) { - setState(() { - topUpParentSiSelectedSI = - value; - }); - topUpParentSiCalculation( - value); - // calculationForTopUpSiSumValue( - // 'Edit'); - }, - decoration: - InputDecoration( - border: - OutlineInputBorder(), - hintText: - 'Sum Insured', - labelText: - 'Sum Insured', - contentPadding: - EdgeInsets - .symmetric( - vertical: - 5, - horizontal: - 5), - ), - value: - topUpParentSiSelectedSI, - items: (topUpParentSlabRates ?? - []) - .map< - DropdownMenuItem< - String>>( - (addOn) { - return DropdownMenuItem< - String>( - value: addOn['si'] - .toString(), - child: Text( - '₹ ${addOn['si']}'), - ); - }).toList(), - ), - ) - ], - ))), - ], - ), - if (_topUpParentSiSwitcher == true) - SizedBox(height: 10), - if (_topUpParentSiSwitcher == - true) // Add space between rows - Row( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Expanded( - flex: 12, - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: - topUpParentMappedFamilyFloatersSi - .where((item) => - item[ - 'is_value_exist'] == - true) - .map((item) { - Map data = - item['data']; - String formattedDate = - formatDate(data['dob']); - return Row( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Icon(Icons.arrow_right, - color: Color( - 0xFFE26728)), // Arrow icon - SizedBox( - width: Responsive - .isDesktop( - context) - ? 10 - : 5), // Space between icon and text - Expanded( - child: Text( - '${data['name']} ~ ${data['relationship']} ~ DOB : $formattedDate', - style: - GoogleFonts.poppins( - fontSize: Responsive - .isDesktop( - context) - ? 18 - : 16, - color: - Color(0xFF232526), - ), - ), - ), - ], - ); - }).toList(), - ), - ) - ], - ), - if (_topUpParentSiSwitcher == true) - SizedBox(height: 20), - if (Responsive.isDesktop(context) && - _topUpParentSiSwitcher == true) - Row( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Expanded( - flex: 5, - child: Container( - alignment: Alignment.center, - child: Column( - mainAxisAlignment: - MainAxisAlignment - .center, - crossAxisAlignment: - CrossAxisAlignment - .center, - children: [ - Text( - 'Additional Premium', - textAlign: - TextAlign.start, - style: - GoogleFonts.poppins( - fontSize: 20, - fontWeight: - FontWeight.w500, - ), - ), - Text( - topUpParentSiPremiumValue != - null - ? '₹ $topUpParentSiPremiumValue/Year' - : 'N/A', - textAlign: - TextAlign.start, - style: - GoogleFonts.poppins( - fontSize: 18, - ), - ), - ], - ))), - Expanded( - flex: 2, - child: Container( - alignment: Alignment.center, - child: Column( - mainAxisAlignment: - MainAxisAlignment - .center, - crossAxisAlignment: - CrossAxisAlignment - .center, - children: [ - Text( - 'GST', - textAlign: - TextAlign.start, - style: - GoogleFonts.poppins( - fontSize: 20, - fontWeight: - FontWeight.w500, - ), - ), - Text( - topUpParentSiPremiumGst != - null - ? '₹ $topUpParentSiPremiumGst/-' - : 'N/A', - textAlign: - TextAlign.start, - style: - GoogleFonts.poppins( - fontSize: 18, - ), - ), - ], - ))), - Expanded( - flex: 5, - child: Container( - alignment: Alignment.center, - child: Column( - mainAxisAlignment: - MainAxisAlignment - .center, - crossAxisAlignment: - CrossAxisAlignment - .center, - children: [ - Text( - 'Total Payable', - textAlign: - TextAlign.start, - style: - GoogleFonts.poppins( - fontSize: 20, - fontWeight: - FontWeight.w500, - ), - ), - Text( - topUpParentSiTotalAmt != - null - ? '₹ $topUpParentSiTotalAmt/-' - : 'N/A', - textAlign: - TextAlign.start, - style: - GoogleFonts.poppins( - fontSize: 18, - ), - ), - ], - ))), - ], - ), - if (!Responsive.isDesktop(context) && - _topUpParentSiSwitcher == true) - Container( - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Row( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Expanded( - flex: 6, - child: Container( - alignment: Alignment - .centerLeft, - child: Column( - mainAxisAlignment: - MainAxisAlignment - .center, - crossAxisAlignment: - CrossAxisAlignment - .center, - children: [ - Text( - 'Additional Premium', - textAlign: - TextAlign - .start, - style: GoogleFonts - .poppins( - fontSize: 18, - fontWeight: - FontWeight - .w500, - ), - ), - ], - ))), - Expanded( - flex: 6, - child: Container( - alignment: Alignment - .centerRight, - child: Column( - mainAxisAlignment: - MainAxisAlignment - .center, - crossAxisAlignment: - CrossAxisAlignment - .center, - children: [ - Text( - topUpParentSiPremiumValue != - null - ? '₹ $topUpParentSiPremiumValue/Year' - : 'N/A', - textAlign: - TextAlign - .start, - style: GoogleFonts - .poppins( - fontSize: 16, - ), - ), - ], - ))), - ], - ), - Row( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Expanded( - flex: 6, - child: Container( - alignment: Alignment - .centerLeft, - child: Column( - mainAxisAlignment: - MainAxisAlignment - .center, - crossAxisAlignment: - CrossAxisAlignment - .center, - children: [ - Text( - 'GST', - textAlign: - TextAlign - .start, - style: GoogleFonts - .poppins( - fontSize: 18, - fontWeight: - FontWeight - .w500, - ), - ), - ], - ))), - Expanded( - flex: 6, - child: Container( - alignment: Alignment - .centerRight, - child: Column( - mainAxisAlignment: - MainAxisAlignment - .center, - crossAxisAlignment: - CrossAxisAlignment - .center, - children: [ - Text( - topUpParentSiPremiumGst != - null - ? '₹ $topUpParentSiPremiumGst/-' - : 'N/A', - textAlign: - TextAlign - .start, - style: GoogleFonts - .poppins( - fontSize: 16, - ), - ), - ], - ))), - ], - ), - Row( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Expanded( - flex: 6, - child: Container( - alignment: Alignment - .centerLeft, - child: Column( - mainAxisAlignment: - MainAxisAlignment - .center, - crossAxisAlignment: - CrossAxisAlignment - .center, - children: [ - Text( - 'Total Payable', - textAlign: - TextAlign - .start, - style: GoogleFonts - .poppins( - fontSize: 18, - fontWeight: - FontWeight - .w500, - ), - ), - ], - ))), - Expanded( - flex: 5, - child: Container( - alignment: Alignment - .centerRight, - child: Column( - mainAxisAlignment: - MainAxisAlignment - .center, - crossAxisAlignment: - CrossAxisAlignment - .center, - children: [ - Text( - topUpParentSiTotalAmt != - null - ? '₹ $topUpParentSiTotalAmt/-' - : 'N/A', - textAlign: - TextAlign - .start, - style: GoogleFonts - .poppins( - fontSize: 16, - ), - ), - ], - ))), - ], - ), - ])) - ], - ), - ), - SizedBox(height: 15), - if (addOnsDependentMappedFamilyFloatersDependent != - null) - Container( - decoration: BoxDecoration( - color: Color( - 0xFFDDF3FF), // Set background color for the container - borderRadius: BorderRadius.circular( - 5), // Set border radius for the container - ), - padding: Responsive.isDesktop(context) - ? EdgeInsets.all(25) - : EdgeInsets.all(10), - child: Column( - children: [ - Row( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Expanded( - flex: - Responsive.isDesktop(context) - ? 6 - : 8, - child: Container( - alignment: - Alignment.centerLeft, - child: Column( - mainAxisAlignment: - MainAxisAlignment.start, - crossAxisAlignment: - CrossAxisAlignment - .start, - children: [ - Text( - addOnsDependentPolicyName ?? - '', - textAlign: - TextAlign.left, - style: - GoogleFonts.poppins( - fontSize: Responsive - .isDesktop( - context) ? 18 : 14, - ), - ), + ), + ), + Row( + children: [ Text( - 'Group Medical Coverage - Dependent AddOns', + 'Group Personal Accident Coverage', textAlign: TextAlign.left, style: @@ -3306,704 +1850,2273 @@ class _addOnsDetailsState extends State { FontWeight.w600, ), ), - ], - ))), - if (Responsive.isDesktop(context) && - _addOnsDependentSwitcher) - Expanded( - flex: 3, - child: Container( - width: 50, - alignment: Alignment.center, - child: Column( - mainAxisAlignment: - MainAxisAlignment - .center, - crossAxisAlignment: - CrossAxisAlignment - .center, - children: [ - IgnorePointer( - ignoring: (addOnsDependentOpenForEnrollment == - 0 || - (addOnsDependentOpenForEnrollment != - 0 && - addOnsDependentECardDownload != - null)), - child: - DropdownButtonFormField< - String>( - onChanged: (value) { - setState(() { - addOnsSelectedDependent = - value; - }); - addOnsDependentCalculation( - value); - // calculationForDependentSumValue( - // 'Edit'); - }, - decoration: - InputDecoration( - border: - OutlineInputBorder(), - hintText: - 'Sum Insured', - labelText: - 'Sum Insured', - contentPadding: - EdgeInsets.symmetric( - vertical: - 5, - horizontal: - 5), + if (gpaECardDownload != + null) + GestureDetector( + onTap: () async { + // Convert the URL string to a Uri object + Uri uri = Uri.parse( + gpaECardDownload); + + // Check if the URL is valid + if (await canLaunchUrl( + uri)) { + // Open the URL in the default browser + await launchUrl( + uri); + } else { + // Handle the case where the URL cannot be launched + print( + 'Could not launch $gpaECardDownload'); + } + }, + child: MouseRegion( + cursor: + SystemMouseCursors + .click, + child: Icon( + Icons + .file_download, + color: Color( + 0xFFE26728), + size: 25, ), - value: - addOnsSelectedDependent, - items: (addOnsDependentSlabRates ?? - []) - .map< - DropdownMenuItem< - String>>( - (addOn) { - return DropdownMenuItem< - String>( - value: addOn[ - 'si'] - .toString(), - child: Text( - '₹ ${addOn['si']}'), - ); - }).toList(), ), - ) - ], - ))), - Expanded( - flex: 3, - child: Container( - alignment: - Alignment.centerRight, - child: Column( - mainAxisAlignment: - MainAxisAlignment.end, - crossAxisAlignment: - CrossAxisAlignment.end, - children: [ - Switch( - value: - _addOnsDependentSwitcher, - onChanged: (addOnsDependentOpenForEnrollment == - 0 || - (addOnsDependentOpenForEnrollment != - 0 && - addOnsDependentECardDownload != - null)) - ? null - : (value) { - setState(() { - _addOnsDependentSwitcher = - value; - // Add your logic here based on the toggle state - }); - }, - activeColor: Color( - 0xFFE26728), // Color when the switch is ON - inactiveTrackColor: Colors - .grey, // Color of the switch track when OFF - ), + ), ], - ))), + ), + ], + ))), + Expanded( + flex: 4, + child: Container( + alignment: Alignment.centerRight, + child: Column( + mainAxisAlignment: + MainAxisAlignment.end, + crossAxisAlignment: + CrossAxisAlignment.end, + children: [ + Text( + 'Sum Insured', + textAlign: TextAlign.right, + style: GoogleFonts.poppins( + fontSize: + Responsive.isDesktop( + context) + ? 18 + : 14, + ), + ), + Text( + '₹ ${gpasumInsured != null ? gpasumInsured : 'NA'}', + textAlign: TextAlign.right, + style: GoogleFonts.poppins( + fontSize: + Responsive.isDesktop( + context) + ? 20 + : 16, + fontWeight: + FontWeight.w600, + ), + ), + ], + ))), + ], + ), + ), + SizedBox(height: 15), + Container( + padding: Responsive.isDesktop(context) + ? EdgeInsets.only( + top: 0, + bottom: 0, + left: 15, + right: 15) + : EdgeInsets.only( + top: 0, bottom: 0, left: 5, right: 5), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Row( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Icon(Icons.arrow_right, + color: Color( + 0xFFE26728)), // Arrow icon + SizedBox( + width: Responsive.isDesktop( + context) + ? 10 + : 5), // Space between icon and text + Expanded( + child: Text( + gpaSelfDetails ?? '', + style: GoogleFonts.poppins( + fontSize: Responsive.isDesktop( + context) + ? 18 + : 16, + color: Color(0xFF232526), + ), + ), + ), ], ), - if (_addOnsDependentSwitcher == true) - SizedBox(height: 10), - if (!Responsive.isDesktop(context) && - _addOnsDependentSwitcher == true) - Row( - children: [ - Expanded( - flex: 3, - child: Container( - width: 50, - alignment: Alignment.center, - child: Column( - mainAxisAlignment: - MainAxisAlignment - .center, - crossAxisAlignment: - CrossAxisAlignment - .center, - children: [ - IgnorePointer( - ignoring: (addOnsDependentOpenForEnrollment == - 0 || - (addOnsDependentOpenForEnrollment != - 0 && - addOnsDependentECardDownload != - null)), - child: - DropdownButtonFormField< - String>( - onChanged: (value) { - setState(() { - addOnsSelectedDependent = - value; - }); - addOnsDependentCalculation( - value); - // calculationForDependentSumValue( - // 'Edit'); - }, - decoration: - InputDecoration( - border: - OutlineInputBorder(), - hintText: - 'Sum Insured', - labelText: - 'Sum Insured', - contentPadding: - EdgeInsets.symmetric( - vertical: - 5, - horizontal: - 5), - ), - value: - addOnsSelectedDependent, - items: (addOnsDependentSlabRates ?? - []) - .map< - DropdownMenuItem< - String>>( - (addOn) { - return DropdownMenuItem< - String>( - value: addOn[ - 'si'] - .toString(), - child: Text( - '₹ ${addOn['si']}'), - ); - }).toList(), - ), - ) - ], - ))), - ], - ), - SizedBox(height: 20), - if (_addOnsDependentSwitcher == true) - Column( - children: familyFloaterContainers, - ), - if (_addOnsDependentSwitcher) - SizedBox(height: 20), - if (Responsive.isDesktop(context) && - _addOnsDependentSwitcher) + ], + ), + ), + ], + ), + )), + SizedBox(height: 16), + if (gmcPolicies != null && gmcPolicies.length > 0) + Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + ...generateGmcCards(gmcPolicies), + ], + ), + SizedBox(height: 16), + if (addOnsDependentMappedFamilyFloatersDependent != null || + topUpMappedFamilyFloatersSi != null) + Card( + elevation: 0, + color: Colors.white, + child: Padding( + padding: Responsive.isDesktop(context) + ? EdgeInsets.all(30) + : EdgeInsets.all(10), + child: Column( + children: [ + Container( + child: Row( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Expanded( + flex: 12, + child: Container( + alignment: Alignment.centerLeft, + child: Column( + mainAxisAlignment: + MainAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Text( + 'Add Ons', + textAlign: TextAlign.left, + style: GoogleFonts.poppins( + fontSize: Responsive + .isDesktop( + context) + ? 20 + : 18, + fontWeight: + FontWeight.w600, + color: + Color(0xFF181818)), + ), + Text( + 'Increase your medical cover for your family or add parents or parent in laws by paying additional premium', + textAlign: TextAlign.left, + style: GoogleFonts.poppins( + fontSize: + Responsive.isDesktop( + context) + ? 18 + : 15, + color: Color(0xFF181818), + ), + ), + ], + ))), + ], + ), + ), + SizedBox(height: 15), + if (topUpMappedFamilyFloatersSi != null) + Container( + decoration: BoxDecoration( + color: Color( + 0xFFDDF3FF), // Set background color for the container + borderRadius: BorderRadius.circular( + 5), // Set border radius for the container + ), + padding: Responsive.isDesktop(context) + ? EdgeInsets.all(25) + : EdgeInsets.all(10), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ Expanded( - flex: 5, + flex: Responsive.isDesktop( + context) + ? 6 + : 8, child: Container( - alignment: Alignment.center, + alignment: + Alignment.centerLeft, child: Column( mainAxisAlignment: MainAxisAlignment - .center, + .start, crossAxisAlignment: CrossAxisAlignment - .center, + .start, children: [ Text( - 'Additional Premium', + topUpPolicyName ?? '', textAlign: - TextAlign.start, + TextAlign.left, style: GoogleFonts .poppins( - fontSize: 20, - fontWeight: - FontWeight.w500, + fontSize: Responsive + .isDesktop( + context) + ? 18 + : 14, ), ), Text( - addOnDependentPremiumValue != - null - ? '₹ $addOnDependentPremiumValue/Year' - : 'N/A', + topUpTypeName ?? '', textAlign: - TextAlign.start, + TextAlign.left, style: GoogleFonts .poppins( - fontSize: 18, + fontSize: Responsive + .isDesktop( + context) + ? 20 + : 16, + fontWeight: + FontWeight.w600, ), ), ], ))), + if (Responsive.isDesktop(context) && + _topUpSiSwitcher == true) + Expanded( + flex: 3, + child: Container( + width: 50, + alignment: + Alignment.center, + child: Column( + mainAxisAlignment: + MainAxisAlignment + .center, + crossAxisAlignment: + CrossAxisAlignment + .center, + children: [ + IgnorePointer( + ignoring: (topUpOpenForEnrollment == + 0 || + (topUpOpenForEnrollment != + 0 && + topUpECardDownload != + null)), + child: + DropdownButtonFormField< + String>( + onChanged: + (value) { + setState(() { + topUpSiSelectedSI = + value; + }); + topUpSiCalculation( + value); + // calculationForTopUpSiSumValue( + // 'Edit'); + }, + decoration: + InputDecoration( + border: + OutlineInputBorder(), + hintText: + 'Sum Insured', + labelText: + 'Sum Insured', + contentPadding: + EdgeInsets.symmetric( + vertical: + 5, + horizontal: + 5), + ), + value: + topUpSiSelectedSI, + items: (topUpSlabRates ?? + []) + .map>( + (addOn) { + return DropdownMenuItem< + String>( + value: addOn[ + 'si'] + .toString(), + child: Text( + '₹ ${addOn['si']}'), + ); + }).toList(), + ), + ) + ], + ))), Expanded( - flex: 2, + flex: 3, child: Container( - alignment: Alignment.center, + alignment: + Alignment.centerRight, child: Column( mainAxisAlignment: - MainAxisAlignment - .center, + MainAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment - .center, + .end, children: [ - Text( - 'GST', - textAlign: - TextAlign.start, - style: GoogleFonts - .poppins( - fontSize: 20, - fontWeight: - FontWeight.w500, - ), - ), - Text( - addOnsDependentPremiumGst != - null - ? '₹ $addOnsDependentPremiumGst/-' - : 'N/A', - textAlign: - TextAlign.start, - style: GoogleFonts - .poppins( - fontSize: 18, - ), - ), - ], - ))), - Expanded( - flex: 5, - child: Container( - alignment: Alignment.center, - child: Column( - mainAxisAlignment: - MainAxisAlignment - .center, - crossAxisAlignment: - CrossAxisAlignment - .center, - children: [ - Text( - 'Total Payable', - textAlign: - TextAlign.start, - style: GoogleFonts - .poppins( - fontSize: 20, - fontWeight: - FontWeight.w500, - ), - ), - Text( - addOnsDependentTotalAmt != - null - ? '₹ $addOnsDependentTotalAmt/-' - : 'N/A', - textAlign: - TextAlign.start, - style: GoogleFonts - .poppins( - fontSize: 18, - ), + Switch( + value: + _topUpSiSwitcher, + onChanged: (topUpOpenForEnrollment == + 0 || + (topUpOpenForEnrollment != + 0 && + topUpECardDownload != + null)) + ? null + : (value) { + setState(() { + _topUpSiSwitcher = + value; + // Add your logic here based on the toggle state + }); + }, + activeColor: Color( + 0xFFE26728), // Color when the switch is ON + inactiveTrackColor: Colors + .grey, // Color of the switch track when OFF ), ], ))), ], ), - if (!Responsive.isDesktop(context) && - _addOnsDependentSwitcher == true) - Container( - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Row( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Expanded( - flex: 6, - child: Container( - alignment: Alignment - .centerLeft, - child: Column( - mainAxisAlignment: - MainAxisAlignment - .center, - crossAxisAlignment: - CrossAxisAlignment - .center, - children: [ - Text( - 'Additional Premium', - textAlign: - TextAlign - .start, - style: - GoogleFonts - .poppins( - fontSize: 18, - fontWeight: - FontWeight - .w500, - ), + if (_topUpSiSwitcher == true) + SizedBox(height: 10), + if (!Responsive.isDesktop(context) && + _topUpSiSwitcher == true) + Row( + children: [ + Expanded( + flex: 12, + child: Container( + width: 50, + alignment: + Alignment.center, + child: Column( + mainAxisAlignment: + MainAxisAlignment + .center, + crossAxisAlignment: + CrossAxisAlignment + .center, + children: [ + IgnorePointer( + ignoring: (topUpOpenForEnrollment == + 0 || + (topUpOpenForEnrollment != + 0 && + topUpECardDownload != + null)), + child: + DropdownButtonFormField< + String>( + onChanged: + (value) { + setState(() { + topUpSiSelectedSI = + value; + }); + topUpSiCalculation( + value); + // calculationForTopUpSiSumValue( + // 'Edit'); + }, + decoration: + InputDecoration( + border: + OutlineInputBorder(), + hintText: + 'Sum Insured', + labelText: + 'Sum Insured', + contentPadding: + EdgeInsets.symmetric( + vertical: + 5, + horizontal: + 5), ), - ], - ))), - Expanded( - flex: 6, - child: Container( - alignment: Alignment - .centerRight, - child: Column( - mainAxisAlignment: - MainAxisAlignment - .center, - crossAxisAlignment: - CrossAxisAlignment - .center, - children: [ - Text( - addOnDependentPremiumValue != - null - ? '₹ $addOnDependentPremiumValue/Year' - : 'N/A', - textAlign: - TextAlign - .start, - style: - GoogleFonts - .poppins( - fontSize: 16, - ), - ), - ], - ))), - ], - ), - Row( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Expanded( - flex: 6, - child: Container( - alignment: Alignment - .centerLeft, - child: Column( - mainAxisAlignment: - MainAxisAlignment - .center, - crossAxisAlignment: - CrossAxisAlignment - .center, - children: [ - Text( - 'GST', - textAlign: - TextAlign - .start, - style: - GoogleFonts - .poppins( - fontSize: 18, - fontWeight: - FontWeight - .w500, - ), - ), - ], - ))), - Expanded( - flex: 6, - child: Container( - alignment: Alignment - .centerRight, - child: Column( - mainAxisAlignment: - MainAxisAlignment - .center, - crossAxisAlignment: - CrossAxisAlignment - .center, - children: [ - Text( - addOnsDependentPremiumGst != - null - ? '₹ $addOnsDependentPremiumGst/-' - : 'N/A', - textAlign: - TextAlign - .start, - style: - GoogleFonts - .poppins( - fontSize: 16, - ), - ), - ], - ))), - ], - ), - Row( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Expanded( - flex: 6, - child: Container( - alignment: Alignment - .centerLeft, - child: Column( - mainAxisAlignment: - MainAxisAlignment - .center, - crossAxisAlignment: - CrossAxisAlignment - .center, - children: [ - Text( - 'Total Payable', - textAlign: - TextAlign - .start, - style: - GoogleFonts - .poppins( - fontSize: 18, - fontWeight: - FontWeight - .w500, - ), - ), - ], - ))), - Expanded( - flex: 5, - child: Container( - alignment: Alignment - .centerRight, - child: Column( - mainAxisAlignment: - MainAxisAlignment - .center, - crossAxisAlignment: - CrossAxisAlignment - .center, - children: [ - Text( - addOnsDependentTotalAmt != - null - ? '₹ $addOnsDependentTotalAmt/-' - : 'N/A', - textAlign: - TextAlign - .start, - style: - GoogleFonts - .poppins( - fontSize: 16, - ), - ), - ], - ))), - ], - ), - ])) - ], - )), - ], - ), - )), - SizedBox(height: 16), - if (addOnsDependentMappedFamilyFloatersDependent == null && - topUpMappedFamilyFloatersSi == null && - topUpParentMappedFamilyFloatersSi == null) - Card( - elevation: 0, - child: Padding( - padding: Responsive.isDesktop(context) - ? EdgeInsets.all(30) - : EdgeInsets.all(10), - child: Column( - children: [ - Container( - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Expanded( - flex: 1, - child: Container( - alignment: Alignment.centerLeft, - child: Column( - mainAxisAlignment: - MainAxisAlignment.start, + value: + topUpSiSelectedSI, + items: (topUpSlabRates ?? + []) + .map>( + (addOn) { + return DropdownMenuItem< + String>( + value: addOn[ + 'si'] + .toString(), + child: Text( + '₹ ${addOn['si']}'), + ); + }).toList(), + ), + ) + ], + ))), + ], + ), + if (_topUpSiSwitcher == true) + SizedBox(height: 10), + if (_topUpSiSwitcher == + true) // Add space between rows + Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Checkbox( - value: isChecked, - onChanged: (bool? value) { - setState(() { - isChecked = value!; - }); - }, - activeColor: Color(0xFFE26728), - ), - ], - ))), - Expanded( - flex: 11, - child: Container( - alignment: Alignment.centerRight, - child: Column( - mainAxisAlignment: - MainAxisAlignment.end, - crossAxisAlignment: - CrossAxisAlignment.end, - children: [ - Text( - 'I declare that the information I have provided is true and accurate to the best of my knowledge', - textAlign: Responsive.isDesktop( - context) - ? TextAlign.left - : TextAlign.start, - style: GoogleFonts.poppins( - fontSize: - Responsive.isDesktop( - context) - ? 18 - : 15, - color: Color(0xFF292929), + Expanded( + flex: 12, + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: + topUpMappedFamilyFloatersSi + .where((item) => + item[ + 'is_value_exist'] == + true) + .map((item) { + Map data = + item['data']; + String formattedDate = + formatDate(data['dob']); + return Row( + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + Icon(Icons.arrow_right, + color: Color( + 0xFFE26728)), // Arrow icon + SizedBox( + width: Responsive + .isDesktop( + context) + ? 10 + : 5), // Space between icon and text + Expanded( + child: Text( + '${data['name']} ~ ${data['relationship']} ~ DOB : $formattedDate', + style: GoogleFonts + .poppins( + fontSize: Responsive + .isDesktop( + context) + ? 18 + : 16, + color: Color( + 0xFF232526), + ), + ), + ), + ], + ); + }).toList(), ), - ), + ) ], - ))), - ], - ), - ), - SizedBox( - height: Responsive.isDesktop(context) ? 15 : 0), - Container( - child: Row( - children: [ - Expanded( - flex: 6, - child: Container( - width: 150, - height: Responsive.isDesktop(context) - ? 150 - : 100, - alignment: Alignment.centerLeft, - child: ElevatedButton( - onPressed: () { - Navigator.pushNamed( - context, 'empDetails'); - }, - child: Text( - 'Back', - style: GoogleFonts.poppins( - color: Color(0xFFE26728)), ), - style: ElevatedButton.styleFrom( - backgroundColor: Colors.white, - shape: RoundedRectangleBorder( - borderRadius: - BorderRadius.circular(5), - side: BorderSide( - color: Color(0xFFE26728)), - ), + if (_topUpSiSwitcher == true) + SizedBox(height: 20), + if (Responsive.isDesktop(context) && + _topUpSiSwitcher == true) + Row( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Expanded( + flex: 5, + child: Container( + alignment: + Alignment.center, + child: Column( + mainAxisAlignment: + MainAxisAlignment + .center, + crossAxisAlignment: + CrossAxisAlignment + .center, + children: [ + Text( + 'Additional Premium', + textAlign: + TextAlign.start, + style: GoogleFonts + .poppins( + fontSize: 20, + fontWeight: + FontWeight + .w500, + ), + ), + Text( + topUpSiPremiumValue != + null + ? '₹ $topUpSiPremiumValue/Year' + : 'N/A', + textAlign: + TextAlign.start, + style: GoogleFonts + .poppins( + fontSize: 18, + ), + ), + ], + ))), + Expanded( + flex: 2, + child: Container( + alignment: + Alignment.center, + child: Column( + mainAxisAlignment: + MainAxisAlignment + .center, + crossAxisAlignment: + CrossAxisAlignment + .center, + children: [ + Text( + 'GST', + textAlign: + TextAlign.start, + style: GoogleFonts + .poppins( + fontSize: 20, + fontWeight: + FontWeight + .w500, + ), + ), + Text( + topUpSiPremiumGst != + null + ? '₹ $topUpSiPremiumGst/-' + : 'N/A', + textAlign: + TextAlign.start, + style: GoogleFonts + .poppins( + fontSize: 18, + ), + ), + ], + ))), + Expanded( + flex: 5, + child: Container( + alignment: + Alignment.center, + child: Column( + mainAxisAlignment: + MainAxisAlignment + .center, + crossAxisAlignment: + CrossAxisAlignment + .center, + children: [ + Text( + 'Total Payable', + textAlign: + TextAlign.start, + style: GoogleFonts + .poppins( + fontSize: 20, + fontWeight: + FontWeight + .w500, + ), + ), + Text( + topUpSiTotalAmt != + null + ? '₹ $topUpSiTotalAmt/-' + : 'N/A', + textAlign: + TextAlign.start, + style: GoogleFonts + .poppins( + fontSize: 18, + ), + ), + ], + ))), + ], ), - ), - )), - Expanded( - flex: 6, - child: Container( - width: 150, - height: 150, - alignment: Alignment.centerRight, - child: ElevatedButton( - onPressed: - isChecked ? sendAddOnAPI : null, - child: Text( - 'Submit', - style: GoogleFonts.poppins( - color: Colors.white), - ), - style: ElevatedButton.styleFrom( - backgroundColor: Color(0xFFE26728), - shape: RoundedRectangleBorder( - borderRadius: - BorderRadius.circular(5), - ), - ), - ), - )), - ], - ), - ), - ], - ), - )) - else - Card( - elevation: 0, - child: Container( - width: double.infinity, - height: 75, - padding: Responsive.isDesktop(context) - ? EdgeInsets.only( - top: 20, bottom: 20, left: 30, right: 30) - : EdgeInsets.only( - top: 10, - bottom: 10, - left: 10, - right: 10), // Add padding to the container - child: Row( - children: [ - Expanded( - flex: 6, - child: Container( - width: 150, - height: 150, - alignment: Alignment.centerLeft, - child: ElevatedButton( - onPressed: () { - backFunction(); - }, - child: Text( - 'Back', - style: GoogleFonts.poppins( - color: Color(0xFFE26728)), - ), - style: ElevatedButton.styleFrom( - backgroundColor: Colors.white, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(5), - side: - BorderSide(color: Color(0xFFE26728)), + if (!Responsive.isDesktop(context) && + _topUpSiSwitcher == true) + Container( + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Row( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Expanded( + flex: 6, + child: Container( + alignment: Alignment + .centerLeft, + child: Column( + mainAxisAlignment: + MainAxisAlignment + .center, + crossAxisAlignment: + CrossAxisAlignment + .center, + children: [ + Text( + 'Additional Premium', + textAlign: + TextAlign + .start, + style: GoogleFonts + .poppins( + fontSize: + 18, + fontWeight: + FontWeight + .w500, + ), + ), + ], + ))), + Expanded( + flex: 6, + child: Container( + alignment: Alignment + .centerRight, + child: Column( + mainAxisAlignment: + MainAxisAlignment + .center, + crossAxisAlignment: + CrossAxisAlignment + .center, + children: [ + Text( + topUpSiPremiumValue != + null + ? '₹ $topUpSiPremiumValue/Year' + : 'N/A', + textAlign: + TextAlign + .start, + style: GoogleFonts + .poppins( + fontSize: + 16, + ), + ), + ], + ))), + ], + ), + Row( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Expanded( + flex: 6, + child: Container( + alignment: Alignment + .centerLeft, + child: Column( + mainAxisAlignment: + MainAxisAlignment + .center, + crossAxisAlignment: + CrossAxisAlignment + .center, + children: [ + Text( + 'GST', + textAlign: + TextAlign + .start, + style: GoogleFonts + .poppins( + fontSize: + 18, + fontWeight: + FontWeight + .w500, + ), + ), + ], + ))), + Expanded( + flex: 6, + child: Container( + alignment: Alignment + .centerRight, + child: Column( + mainAxisAlignment: + MainAxisAlignment + .center, + crossAxisAlignment: + CrossAxisAlignment + .center, + children: [ + Text( + topUpSiPremiumGst != + null + ? '₹ $topUpSiPremiumGst/-' + : 'N/A', + textAlign: + TextAlign + .start, + style: GoogleFonts + .poppins( + fontSize: + 16, + ), + ), + ], + ))), + ], + ), + Row( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Expanded( + flex: 6, + child: Container( + alignment: Alignment + .centerLeft, + child: Column( + mainAxisAlignment: + MainAxisAlignment + .center, + crossAxisAlignment: + CrossAxisAlignment + .center, + children: [ + Text( + 'Total Payable', + textAlign: + TextAlign + .start, + style: GoogleFonts + .poppins( + fontSize: + 18, + fontWeight: + FontWeight + .w500, + ), + ), + ], + ))), + Expanded( + flex: 5, + child: Container( + alignment: Alignment + .centerRight, + child: Column( + mainAxisAlignment: + MainAxisAlignment + .center, + crossAxisAlignment: + CrossAxisAlignment + .center, + children: [ + Text( + topUpSiTotalAmt != + null + ? '₹ $topUpSiTotalAmt/-' + : 'N/A', + textAlign: + TextAlign + .start, + style: GoogleFonts + .poppins( + fontSize: + 16, + ), + ), + ], + ))), + ], + ), + ])) + ], ), ), + SizedBox(height: 15), + if (topUpParentMappedFamilyFloatersSi != null) + Container( + decoration: BoxDecoration( + color: Color( + 0xFFDDF3FF), // Set background color for the container + borderRadius: BorderRadius.circular( + 5), // Set border radius for the container + ), + padding: Responsive.isDesktop(context) + ? EdgeInsets.all(25) + : EdgeInsets.all(10), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Row( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Expanded( + flex: Responsive.isDesktop( + context) + ? 6 + : 8, + child: Container( + alignment: + Alignment.centerLeft, + child: Column( + mainAxisAlignment: + MainAxisAlignment + .start, + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + Text( + topUpParentPolicyName ?? + '', + textAlign: + TextAlign.left, + style: GoogleFonts + .poppins( + fontSize: Responsive + .isDesktop( + context) + ? 18 + : 14, + ), + ), + Text( + topUpParentTypeName ?? + '', + textAlign: + TextAlign.left, + style: GoogleFonts + .poppins( + fontSize: Responsive + .isDesktop( + context) + ? 20 + : 16, + fontWeight: + FontWeight.w600, + ), + ), + ], + ))), + if (Responsive.isDesktop(context) && + _topUpParentSiSwitcher == true) + Expanded( + flex: 3, + child: Container( + width: 50, + alignment: + Alignment.center, + child: Column( + mainAxisAlignment: + MainAxisAlignment + .center, + crossAxisAlignment: + CrossAxisAlignment + .center, + children: [ + IgnorePointer( + ignoring: (topUpParentOpenForEnrollment == + 0 || + (topUpParentOpenForEnrollment != + 0 && + topUpParentECardDownload != + null)), + child: + DropdownButtonFormField< + String>( + onChanged: + (value) { + setState(() { + topUpParentSiSelectedSI = + value; + }); + topUpParentSiCalculation( + value); + // calculationForTopUpSiSumValue( + // 'Edit'); + }, + decoration: + InputDecoration( + border: + OutlineInputBorder(), + hintText: + 'Sum Insured', + labelText: + 'Sum Insured', + contentPadding: + EdgeInsets.symmetric( + vertical: + 5, + horizontal: + 5), + ), + value: + topUpParentSiSelectedSI, + items: (topUpParentSlabRates ?? + []) + .map>( + (addOn) { + return DropdownMenuItem< + String>( + value: addOn[ + 'si'] + .toString(), + child: Text( + '₹ ${addOn['si']}'), + ); + }).toList(), + ), + ) + ], + ))), + Expanded( + flex: 3, + child: Container( + alignment: + Alignment.centerRight, + child: Column( + mainAxisAlignment: + MainAxisAlignment.end, + crossAxisAlignment: + CrossAxisAlignment + .end, + children: [ + Switch( + value: + _topUpParentSiSwitcher, + onChanged: (topUpParentOpenForEnrollment == + 0 || + (topUpParentOpenForEnrollment != + 0 && + topUpParentECardDownload != + null)) + ? null + : (value) { + setState(() { + _topUpParentSiSwitcher = + value; + // Add your logic here based on the toggle state + }); + }, + activeColor: Color( + 0xFFE26728), // Color when the switch is ON + inactiveTrackColor: Colors + .grey, // Color of the switch track when OFF + ), + ], + ))), + ], + ), + if (_topUpParentSiSwitcher == true) + SizedBox(height: 10), + if (!Responsive.isDesktop(context) && + _topUpParentSiSwitcher == true) + Row( + children: [ + Expanded( + flex: 12, + child: Container( + width: 50, + alignment: + Alignment.center, + child: Column( + mainAxisAlignment: + MainAxisAlignment + .center, + crossAxisAlignment: + CrossAxisAlignment + .center, + children: [ + IgnorePointer( + ignoring: (topUpParentOpenForEnrollment == + 0 || + (topUpParentOpenForEnrollment != + 0 && + topUpParentECardDownload != + null)), + child: + DropdownButtonFormField< + String>( + onChanged: + (value) { + setState(() { + topUpParentSiSelectedSI = + value; + }); + topUpParentSiCalculation( + value); + // calculationForTopUpSiSumValue( + // 'Edit'); + }, + decoration: + InputDecoration( + border: + OutlineInputBorder(), + hintText: + 'Sum Insured', + labelText: + 'Sum Insured', + contentPadding: + EdgeInsets.symmetric( + vertical: + 5, + horizontal: + 5), + ), + value: + topUpParentSiSelectedSI, + items: (topUpParentSlabRates ?? + []) + .map>( + (addOn) { + return DropdownMenuItem< + String>( + value: addOn[ + 'si'] + .toString(), + child: Text( + '₹ ${addOn['si']}'), + ); + }).toList(), + ), + ) + ], + ))), + ], + ), + if (_topUpParentSiSwitcher == true) + SizedBox(height: 10), + if (_topUpParentSiSwitcher == + true) // Add space between rows + Row( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Expanded( + flex: 12, + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: + topUpParentMappedFamilyFloatersSi + .where((item) => + item[ + 'is_value_exist'] == + true) + .map((item) { + Map data = + item['data']; + String formattedDate = + formatDate(data['dob']); + return Row( + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + Icon(Icons.arrow_right, + color: Color( + 0xFFE26728)), // Arrow icon + SizedBox( + width: Responsive + .isDesktop( + context) + ? 10 + : 5), // Space between icon and text + Expanded( + child: Text( + '${data['name']} ~ ${data['relationship']} ~ DOB : $formattedDate', + style: GoogleFonts + .poppins( + fontSize: Responsive + .isDesktop( + context) + ? 18 + : 16, + color: Color( + 0xFF232526), + ), + ), + ), + ], + ); + }).toList(), + ), + ) + ], + ), + if (_topUpParentSiSwitcher == true) + SizedBox(height: 20), + if (Responsive.isDesktop(context) && + _topUpParentSiSwitcher == true) + Row( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Expanded( + flex: 5, + child: Container( + alignment: + Alignment.center, + child: Column( + mainAxisAlignment: + MainAxisAlignment + .center, + crossAxisAlignment: + CrossAxisAlignment + .center, + children: [ + Text( + 'Additional Premium', + textAlign: + TextAlign.start, + style: GoogleFonts + .poppins( + fontSize: 20, + fontWeight: + FontWeight + .w500, + ), + ), + Text( + topUpParentSiPremiumValue != + null + ? '₹ $topUpParentSiPremiumValue/Year' + : 'N/A', + textAlign: + TextAlign.start, + style: GoogleFonts + .poppins( + fontSize: 18, + ), + ), + ], + ))), + Expanded( + flex: 2, + child: Container( + alignment: + Alignment.center, + child: Column( + mainAxisAlignment: + MainAxisAlignment + .center, + crossAxisAlignment: + CrossAxisAlignment + .center, + children: [ + Text( + 'GST', + textAlign: + TextAlign.start, + style: GoogleFonts + .poppins( + fontSize: 20, + fontWeight: + FontWeight + .w500, + ), + ), + Text( + topUpParentSiPremiumGst != + null + ? '₹ $topUpParentSiPremiumGst/-' + : 'N/A', + textAlign: + TextAlign.start, + style: GoogleFonts + .poppins( + fontSize: 18, + ), + ), + ], + ))), + Expanded( + flex: 5, + child: Container( + alignment: + Alignment.center, + child: Column( + mainAxisAlignment: + MainAxisAlignment + .center, + crossAxisAlignment: + CrossAxisAlignment + .center, + children: [ + Text( + 'Total Payable', + textAlign: + TextAlign.start, + style: GoogleFonts + .poppins( + fontSize: 20, + fontWeight: + FontWeight + .w500, + ), + ), + Text( + topUpParentSiTotalAmt != + null + ? '₹ $topUpParentSiTotalAmt/-' + : 'N/A', + textAlign: + TextAlign.start, + style: GoogleFonts + .poppins( + fontSize: 18, + ), + ), + ], + ))), + ], + ), + if (!Responsive.isDesktop(context) && + _topUpParentSiSwitcher == true) + Container( + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Row( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Expanded( + flex: 6, + child: Container( + alignment: Alignment + .centerLeft, + child: Column( + mainAxisAlignment: + MainAxisAlignment + .center, + crossAxisAlignment: + CrossAxisAlignment + .center, + children: [ + Text( + 'Additional Premium', + textAlign: + TextAlign + .start, + style: GoogleFonts + .poppins( + fontSize: + 18, + fontWeight: + FontWeight + .w500, + ), + ), + ], + ))), + Expanded( + flex: 6, + child: Container( + alignment: Alignment + .centerRight, + child: Column( + mainAxisAlignment: + MainAxisAlignment + .center, + crossAxisAlignment: + CrossAxisAlignment + .center, + children: [ + Text( + topUpParentSiPremiumValue != + null + ? '₹ $topUpParentSiPremiumValue/Year' + : 'N/A', + textAlign: + TextAlign + .start, + style: GoogleFonts + .poppins( + fontSize: + 16, + ), + ), + ], + ))), + ], + ), + Row( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Expanded( + flex: 6, + child: Container( + alignment: Alignment + .centerLeft, + child: Column( + mainAxisAlignment: + MainAxisAlignment + .center, + crossAxisAlignment: + CrossAxisAlignment + .center, + children: [ + Text( + 'GST', + textAlign: + TextAlign + .start, + style: GoogleFonts + .poppins( + fontSize: + 18, + fontWeight: + FontWeight + .w500, + ), + ), + ], + ))), + Expanded( + flex: 6, + child: Container( + alignment: Alignment + .centerRight, + child: Column( + mainAxisAlignment: + MainAxisAlignment + .center, + crossAxisAlignment: + CrossAxisAlignment + .center, + children: [ + Text( + topUpParentSiPremiumGst != + null + ? '₹ $topUpParentSiPremiumGst/-' + : 'N/A', + textAlign: + TextAlign + .start, + style: GoogleFonts + .poppins( + fontSize: + 16, + ), + ), + ], + ))), + ], + ), + Row( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Expanded( + flex: 6, + child: Container( + alignment: Alignment + .centerLeft, + child: Column( + mainAxisAlignment: + MainAxisAlignment + .center, + crossAxisAlignment: + CrossAxisAlignment + .center, + children: [ + Text( + 'Total Payable', + textAlign: + TextAlign + .start, + style: GoogleFonts + .poppins( + fontSize: + 18, + fontWeight: + FontWeight + .w500, + ), + ), + ], + ))), + Expanded( + flex: 5, + child: Container( + alignment: Alignment + .centerRight, + child: Column( + mainAxisAlignment: + MainAxisAlignment + .center, + crossAxisAlignment: + CrossAxisAlignment + .center, + children: [ + Text( + topUpParentSiTotalAmt != + null + ? '₹ $topUpParentSiTotalAmt/-' + : 'N/A', + textAlign: + TextAlign + .start, + style: GoogleFonts + .poppins( + fontSize: + 16, + ), + ), + ], + ))), + ], + ), + ])) + ], + ), + ), + SizedBox(height: 15), + if (addOnsDependentMappedFamilyFloatersDependent != + null) + Container( + decoration: BoxDecoration( + color: Color( + 0xFFDDF3FF), // Set background color for the container + borderRadius: BorderRadius.circular( + 5), // Set border radius for the container + ), + padding: Responsive.isDesktop(context) + ? EdgeInsets.all(25) + : EdgeInsets.all(10), + child: Column( + children: [ + Row( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Expanded( + flex: Responsive.isDesktop( + context) + ? 6 + : 8, + child: Container( + alignment: + Alignment.centerLeft, + child: Column( + mainAxisAlignment: + MainAxisAlignment + .start, + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + Text( + addOnsDependentPolicyName ?? + '', + textAlign: + TextAlign.left, + style: GoogleFonts + .poppins( + fontSize: Responsive + .isDesktop( + context) + ? 18 + : 14, + ), + ), + Text( + 'Group Medical Coverage - Dependent AddOns', + textAlign: + TextAlign.left, + style: GoogleFonts + .poppins( + fontSize: Responsive + .isDesktop( + context) + ? 20 + : 16, + fontWeight: + FontWeight + .w600, + ), + ), + ], + ))), + if (Responsive.isDesktop( + context) && + _addOnsDependentSwitcher) + Expanded( + flex: 3, + child: Container( + width: 50, + alignment: + Alignment.center, + child: Column( + mainAxisAlignment: + MainAxisAlignment + .center, + crossAxisAlignment: + CrossAxisAlignment + .center, + children: [ + IgnorePointer( + ignoring: (addOnsDependentOpenForEnrollment == + 0 || + (addOnsDependentOpenForEnrollment != + 0 && + addOnsDependentECardDownload != + null)), + child: + DropdownButtonFormField< + String>( + onChanged: + (value) { + setState(() { + addOnsSelectedDependent = + value; + }); + addOnsDependentCalculation( + value); + // calculationForDependentSumValue( + // 'Edit'); + }, + decoration: + InputDecoration( + border: + OutlineInputBorder(), + hintText: + 'Sum Insured', + labelText: + 'Sum Insured', + contentPadding: + EdgeInsets.symmetric( + vertical: + 5, + horizontal: + 5), + ), + value: + addOnsSelectedDependent, + items: (addOnsDependentSlabRates ?? + []) + .map>( + (addOn) { + return DropdownMenuItem< + String>( + value: addOn[ + 'si'] + .toString(), + child: Text( + '₹ ${addOn['si']}'), + ); + }).toList(), + ), + ) + ], + ))), + Expanded( + flex: 3, + child: Container( + alignment: + Alignment.centerRight, + child: Column( + mainAxisAlignment: + MainAxisAlignment + .end, + crossAxisAlignment: + CrossAxisAlignment + .end, + children: [ + Switch( + value: + _addOnsDependentSwitcher, + onChanged: (addOnsDependentOpenForEnrollment == + 0 || + (addOnsDependentOpenForEnrollment != + 0 && + addOnsDependentECardDownload != + null)) + ? null + : (value) { + setState( + () { + _addOnsDependentSwitcher = + value; + // Add your logic here based on the toggle state + }); + }, + activeColor: Color( + 0xFFE26728), // Color when the switch is ON + inactiveTrackColor: + Colors + .grey, // Color of the switch track when OFF + ), + ], + ))), + ], + ), + if (_addOnsDependentSwitcher == true) + SizedBox(height: 10), + if (!Responsive.isDesktop(context) && + _addOnsDependentSwitcher == true) + Row( + children: [ + Expanded( + flex: 3, + child: Container( + width: 50, + alignment: + Alignment.center, + child: Column( + mainAxisAlignment: + MainAxisAlignment + .center, + crossAxisAlignment: + CrossAxisAlignment + .center, + children: [ + IgnorePointer( + ignoring: (addOnsDependentOpenForEnrollment == + 0 || + (addOnsDependentOpenForEnrollment != + 0 && + addOnsDependentECardDownload != + null)), + child: + DropdownButtonFormField< + String>( + onChanged: + (value) { + setState(() { + addOnsSelectedDependent = + value; + }); + addOnsDependentCalculation( + value); + // calculationForDependentSumValue( + // 'Edit'); + }, + decoration: + InputDecoration( + border: + OutlineInputBorder(), + hintText: + 'Sum Insured', + labelText: + 'Sum Insured', + contentPadding: + EdgeInsets.symmetric( + vertical: + 5, + horizontal: + 5), + ), + value: + addOnsSelectedDependent, + items: (addOnsDependentSlabRates ?? + []) + .map>( + (addOn) { + return DropdownMenuItem< + String>( + value: addOn[ + 'si'] + .toString(), + child: Text( + '₹ ${addOn['si']}'), + ); + }).toList(), + ), + ) + ], + ))), + ], + ), + SizedBox(height: 20), + if (_addOnsDependentSwitcher == true) + Column( + children: familyFloaterContainers, + ), + if (_addOnsDependentSwitcher) + SizedBox(height: 20), + if (Responsive.isDesktop(context) && + _addOnsDependentSwitcher) + Row( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Expanded( + flex: 5, + child: Container( + alignment: + Alignment.center, + child: Column( + mainAxisAlignment: + MainAxisAlignment + .center, + crossAxisAlignment: + CrossAxisAlignment + .center, + children: [ + Text( + 'Additional Premium', + textAlign: + TextAlign + .start, + style: GoogleFonts + .poppins( + fontSize: 20, + fontWeight: + FontWeight + .w500, + ), + ), + Text( + addOnDependentPremiumValue != + null + ? '₹ $addOnDependentPremiumValue/Year' + : 'N/A', + textAlign: + TextAlign + .start, + style: GoogleFonts + .poppins( + fontSize: 18, + ), + ), + ], + ))), + Expanded( + flex: 2, + child: Container( + alignment: + Alignment.center, + child: Column( + mainAxisAlignment: + MainAxisAlignment + .center, + crossAxisAlignment: + CrossAxisAlignment + .center, + children: [ + Text( + 'GST', + textAlign: + TextAlign + .start, + style: GoogleFonts + .poppins( + fontSize: 20, + fontWeight: + FontWeight + .w500, + ), + ), + Text( + addOnsDependentPremiumGst != + null + ? '₹ $addOnsDependentPremiumGst/-' + : 'N/A', + textAlign: + TextAlign + .start, + style: GoogleFonts + .poppins( + fontSize: 18, + ), + ), + ], + ))), + Expanded( + flex: 5, + child: Container( + alignment: + Alignment.center, + child: Column( + mainAxisAlignment: + MainAxisAlignment + .center, + crossAxisAlignment: + CrossAxisAlignment + .center, + children: [ + Text( + 'Total Payable', + textAlign: + TextAlign + .start, + style: GoogleFonts + .poppins( + fontSize: 20, + fontWeight: + FontWeight + .w500, + ), + ), + Text( + addOnsDependentTotalAmt != + null + ? '₹ $addOnsDependentTotalAmt/-' + : 'N/A', + textAlign: + TextAlign + .start, + style: GoogleFonts + .poppins( + fontSize: 18, + ), + ), + ], + ))), + ], + ), + if (!Responsive.isDesktop(context) && + _addOnsDependentSwitcher == true) + Container( + child: Column( + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + Row( + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + Expanded( + flex: 6, + child: Container( + alignment: Alignment + .centerLeft, + child: Column( + mainAxisAlignment: + MainAxisAlignment + .center, + crossAxisAlignment: + CrossAxisAlignment + .center, + children: [ + Text( + 'Additional Premium', + textAlign: + TextAlign + .start, + style: GoogleFonts + .poppins( + fontSize: + 18, + fontWeight: + FontWeight + .w500, + ), + ), + ], + ))), + Expanded( + flex: 6, + child: Container( + alignment: Alignment + .centerRight, + child: Column( + mainAxisAlignment: + MainAxisAlignment + .center, + crossAxisAlignment: + CrossAxisAlignment + .center, + children: [ + Text( + addOnDependentPremiumValue != + null + ? '₹ $addOnDependentPremiumValue/Year' + : 'N/A', + textAlign: + TextAlign + .start, + style: GoogleFonts + .poppins( + fontSize: + 16, + ), + ), + ], + ))), + ], + ), + Row( + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + Expanded( + flex: 6, + child: Container( + alignment: Alignment + .centerLeft, + child: Column( + mainAxisAlignment: + MainAxisAlignment + .center, + crossAxisAlignment: + CrossAxisAlignment + .center, + children: [ + Text( + 'GST', + textAlign: + TextAlign + .start, + style: GoogleFonts + .poppins( + fontSize: + 18, + fontWeight: + FontWeight + .w500, + ), + ), + ], + ))), + Expanded( + flex: 6, + child: Container( + alignment: Alignment + .centerRight, + child: Column( + mainAxisAlignment: + MainAxisAlignment + .center, + crossAxisAlignment: + CrossAxisAlignment + .center, + children: [ + Text( + addOnsDependentPremiumGst != + null + ? '₹ $addOnsDependentPremiumGst/-' + : 'N/A', + textAlign: + TextAlign + .start, + style: GoogleFonts + .poppins( + fontSize: + 16, + ), + ), + ], + ))), + ], + ), + Row( + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + Expanded( + flex: 6, + child: Container( + alignment: Alignment + .centerLeft, + child: Column( + mainAxisAlignment: + MainAxisAlignment + .center, + crossAxisAlignment: + CrossAxisAlignment + .center, + children: [ + Text( + 'Total Payable', + textAlign: + TextAlign + .start, + style: GoogleFonts + .poppins( + fontSize: + 18, + fontWeight: + FontWeight + .w500, + ), + ), + ], + ))), + Expanded( + flex: 5, + child: Container( + alignment: Alignment + .centerRight, + child: Column( + mainAxisAlignment: + MainAxisAlignment + .center, + crossAxisAlignment: + CrossAxisAlignment + .center, + children: [ + Text( + addOnsDependentTotalAmt != + null + ? '₹ $addOnsDependentTotalAmt/-' + : 'N/A', + textAlign: + TextAlign + .start, + style: GoogleFonts + .poppins( + fontSize: + 16, + ), + ), + ], + ))), + ], + ), + ])) + ], + )), + ], + ), + )), + SizedBox(height: 16), + if (addOnsDependentMappedFamilyFloatersDependent == null && + topUpMappedFamilyFloatersSi == null && + topUpParentMappedFamilyFloatersSi == null) + Card( + elevation: 0, + color: Colors.white, + child: Padding( + padding: Responsive.isDesktop(context) + ? EdgeInsets.all(30) + : EdgeInsets.all(10), + child: Column( + children: [ + Container( + child: Row( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Expanded( + flex: 1, + child: Container( + alignment: Alignment.centerLeft, + child: Column( + mainAxisAlignment: + MainAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Checkbox( + value: isChecked, + onChanged: (bool? value) { + setState(() { + isChecked = value!; + }); + }, + activeColor: + Color(0xFFE26728), + ), + ], + ))), + Expanded( + flex: 11, + child: Container( + alignment: Alignment.centerRight, + child: Column( + mainAxisAlignment: + MainAxisAlignment.end, + crossAxisAlignment: + CrossAxisAlignment.end, + children: [ + Text( + 'I declare that the information I have provided is true and accurate to the best of my knowledge', + textAlign: + Responsive.isDesktop( + context) + ? TextAlign.left + : TextAlign.start, + style: GoogleFonts.poppins( + fontSize: + Responsive.isDesktop( + context) + ? 18 + : 15, + color: Color(0xFF292929), + ), + ), + ], + ))), + ], + ), ), - )), - Expanded( - flex: 6, - child: Container( - width: 150, - height: 150, - alignment: Alignment.centerRight, - child: ElevatedButton( - onPressed: - addOnsDependentMappedFamilyFloatersDependent != + SizedBox( + height: + Responsive.isDesktop(context) ? 15 : 0), + Container( + child: Row( + children: [ + Expanded( + flex: 6, + child: Container( + width: 150, + height: + Responsive.isDesktop(context) + ? 150 + : 100, + alignment: Alignment.centerLeft, + child: ElevatedButton( + onPressed: () { + Navigator.pushNamed( + context, 'empDetails'); + }, + child: Text( + 'Back', + style: GoogleFonts.poppins( + color: Color(0xFFE26728)), + ), + style: ElevatedButton.styleFrom( + backgroundColor: Colors.white, + shape: RoundedRectangleBorder( + borderRadius: + BorderRadius.circular(5), + side: BorderSide( + color: Color(0xFFE26728)), + ), + ), + ), + )), + Expanded( + flex: 6, + child: Container( + width: 150, + height: 150, + alignment: Alignment.centerRight, + child: ElevatedButton( + onPressed: isChecked + ? sendAddOnAPI + : null, + child: Text( + 'Submit', + style: GoogleFonts.poppins( + color: Colors.white), + ), + style: ElevatedButton.styleFrom( + backgroundColor: + Color(0xFFE26728), + shape: RoundedRectangleBorder( + borderRadius: + BorderRadius.circular(5), + ), + ), + ), + )), + ], + ), + ), + ], + ), + )) + else + Card( + elevation: 0, + color: Colors.white, + child: Container( + width: double.infinity, + height: 75, + padding: Responsive.isDesktop(context) + ? EdgeInsets.only( + top: 20, bottom: 20, left: 30, right: 30) + : EdgeInsets.only( + top: 10, + bottom: 10, + left: 10, + right: 10), // Add padding to the container + child: Row( + children: [ + Expanded( + flex: 6, + child: Container( + width: 150, + height: 150, + alignment: Alignment.centerLeft, + child: ElevatedButton( + onPressed: () { + backFunction(); + }, + child: Text( + 'Back', + style: GoogleFonts.poppins( + color: Color(0xFFE26728)), + ), + style: ElevatedButton.styleFrom( + backgroundColor: Colors.white, + shape: RoundedRectangleBorder( + borderRadius: + BorderRadius.circular(5), + side: BorderSide( + color: Color(0xFFE26728)), + ), + ), + ), + )), + Expanded( + flex: 6, + child: Container( + width: 150, + height: 150, + alignment: Alignment.centerRight, + child: ElevatedButton( + onPressed: addOnsDependentMappedFamilyFloatersDependent != null || topUpMappedFamilyFloatersSi != null || @@ -4037,28 +4150,48 @@ class _addOnsDetailsState extends State { context, 'empReviewDetails'); } : null, - child: Text( - 'Continue ', - style: GoogleFonts.poppins( - color: Colors.white), - ), - style: ElevatedButton.styleFrom( - backgroundColor: Color(0xFFE26728), - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(5), + child: Text( + 'Continue ', + style: GoogleFonts.poppins( + color: Colors.white), + ), + style: ElevatedButton.styleFrom( + backgroundColor: Color(0xFFE26728), + shape: RoundedRectangleBorder( + borderRadius: + BorderRadius.circular(5), + ), + ), ), - ), - ), - )), - ], + )), + ], + ), + ), ), - ), - ), - ], + SizedBox(height: 30), + ], + ), + ), ), - ), - ), - ); + if (isLoading) + Container( + color: Color(0x98FFFCE5), // Semi-transparent background + child: Center( + child: // Your GIF loader widget + Image.asset( + height: 60, + width: 60, + 'assets/nhance-loader.gif'), // Adjust path to your GIF loader + ), + ), + Align( + alignment: Alignment.bottomCenter, + child: Container( + width: double.infinity, // Make the footer full width + child: CustomFooter(), + ), + ), + ])); } } @@ -4130,6 +4263,7 @@ class _addOnsDetailsState extends State { child: SingleChildScrollView( child: Card( elevation: 0, + color: Colors.white, child: Padding( padding: EdgeInsets.all(30), child: Column( @@ -4404,6 +4538,7 @@ class _addOnsDetailsState extends State { Widget card = getTrueObjects.length > 0 ? Card( elevation: 0, + color: Colors.white, child: Padding( padding: Responsive.isDesktop(context) ? EdgeInsets.all(30) diff --git a/lib/customAppBar/customAppBar.dart b/lib/customAppBar/customAppBar.dart index 015d0c9..01c8edd 100644 --- a/lib/customAppBar/customAppBar.dart +++ b/lib/customAppBar/customAppBar.dart @@ -15,7 +15,7 @@ class CustomAppBar extends StatefulWidget implements PreferredSizeWidget { class _CustomAppBarState extends State { bool showBackToHR = true; - bool hideInactiveStatus = true; + // bool hideInactiveStatus = true; @override void initState() { @@ -32,7 +32,7 @@ class _CustomAppBarState extends State { showBackToHR = (hrtoken != null && hrtoken.isNotEmpty) && (token != null && token.isNotEmpty); - hideInactiveStatus = token != null && token.isNotEmpty; + // hideInactiveStatus = token != null && token.isNotEmpty; }); } @@ -113,14 +113,14 @@ class _CustomAppBarState extends State { Container(), // Set an empty container as we have the logo separately title: Text(''), navBarItems: [ - if (Responsive.isDesktop(context)) - if (hideInactiveStatus) - NavBarItem( - text: "Inactive Policy", - onTap: () { - Navigator.pushNamed(context, 'oldPolicy'); - }, - ), + // if (Responsive.isDesktop(context)) + // if (hideInactiveStatus) + // NavBarItem( + // text: "Inactive Policy", + // onTap: () { + // Navigator.pushNamed(context, 'oldPolicy'); + // }, + // ), if (showBackToHR) NavBarItem( text: "Back To HR", diff --git a/lib/customAppBar/customFooter.dart b/lib/customAppBar/customFooter.dart new file mode 100644 index 0000000..db7f7b2 --- /dev/null +++ b/lib/customAppBar/customFooter.dart @@ -0,0 +1,23 @@ +import 'package:flutter/material.dart'; + +class CustomFooter extends StatelessWidget { + @override + Widget build(BuildContext context) { + return Container( + padding: EdgeInsets.all(8.0), + color: Color(0xFFFFFBDE), // Background color of the footer + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Text( + 'Copyright@ 2024 Nhance - Jubiliant', + style: TextStyle( + fontSize: 14, + color: Colors.grey[600], // Text color + ), + ), + ], + ), + ); + } +} diff --git a/lib/empDetails.dart b/lib/empDetails.dart index b22d149..3818a65 100644 --- a/lib/empDetails.dart +++ b/lib/empDetails.dart @@ -17,6 +17,8 @@ import 'dart:async'; import 'package:nhancepolicy/responsive.dart'; import 'package:url_launcher/url_launcher.dart'; +import 'customAppBar/customFooter.dart'; + class empDetails extends StatefulWidget { const empDetails({Key? key}) : super(key: key); @@ -682,6 +684,7 @@ class _empDetailsState extends State { children: [ Card( elevation: 0, + color: Colors.white, child: Container( width: double.infinity, height: 75, @@ -753,6 +756,7 @@ class _empDetailsState extends State { SizedBox(height: 16), Card( elevation: 0, + color: Colors.white, child: Container( width: double.infinity, height: MediaQuery.of(context).size.height, @@ -798,6 +802,7 @@ class _empDetailsState extends State { children: [ Card( elevation: 0, + color: Colors.white, child: Container( width: double.infinity, height: 75, @@ -870,6 +875,7 @@ class _empDetailsState extends State { if (gpaPolicies != null && gpaPolicies.length > 0) Card( elevation: 0, + color: Colors.white, child: Padding( padding: Responsive.isDesktop(context) ? EdgeInsets.all(30) @@ -1224,6 +1230,7 @@ class _empDetailsState extends State { if (gmcPolicies != null && gmcPolicies.length > 0) Card( elevation: 0, + color: Colors.white, child: Container( width: double.infinity, height: 75, @@ -1266,13 +1273,14 @@ class _empDetailsState extends State { ), ), ), + SizedBox(height: 30), ], ), ), ), if (isLoading) Container( - color: Color(0xFFFFFCE5), // Semi-transparent background + color: Color(0x98FFFCE5), // Semi-transparent background child: Center( child: // Your GIF loader widget Image.asset( @@ -1281,6 +1289,13 @@ class _empDetailsState extends State { 'assets/nhance-loader.gif'), // Adjust path to your GIF loader ), ), + Align( + alignment: Alignment.bottomCenter, + child: Container( + width: double.infinity, // Make the footer full width + child: CustomFooter(), + ), + ), ])); } } @@ -1348,6 +1363,7 @@ class _empDetailsState extends State { child: SingleChildScrollView( child: Card( elevation: 0, + color: Colors.white, child: Padding( padding: Responsive.isDesktop(context) ? EdgeInsets.all(30) @@ -1602,6 +1618,7 @@ class _empDetailsState extends State { child: SingleChildScrollView( child: Card( elevation: 0, + color: Colors.white, child: Padding( padding: Responsive.isDesktop(context) ? EdgeInsets.all(30) @@ -2216,6 +2233,7 @@ class _empDetailsState extends State { Widget card = Card( elevation: 0, + color: Colors.white, child: Padding( padding: Responsive.isDesktop(context) ? EdgeInsets.all(30) diff --git a/lib/empReview.dart b/lib/empReview.dart index 9c57143..e1c9b07 100644 --- a/lib/empReview.dart +++ b/lib/empReview.dart @@ -15,6 +15,8 @@ import 'package:flutter/services.dart'; import 'dart:convert'; import 'package:url_launcher/url_launcher.dart'; +import 'customAppBar/customFooter.dart'; + class empReviewDetails extends StatefulWidget { const empReviewDetails({Key? key}) : super(key: key); @@ -24,6 +26,7 @@ class empReviewDetails extends StatefulWidget { class _empReviewDetailsState extends State { late ApiService apiService; + bool isLoading = true; bool isChecked = false; // Declare the _isSwitched variable here dynamic _token; dynamic empCodeString; @@ -123,6 +126,11 @@ class _empReviewDetailsState extends State { super.initState(); apiService = ApiService(context); // Initialize ApiService here _loadToken(); + Future.delayed(Duration(seconds: 5), () { + setState(() { + isLoading = false; + }); + }); } @override @@ -163,11 +171,12 @@ class _empReviewDetailsState extends State { } else { getClientLogoAndDetails(); } + + getGpaEmpPolicyDetails(empPrimaryId); + getGmcEmpPolicyDetails(empPrimaryId); getGmcSiTopUp(); getGmcSiParentTopUp(); getGmcDependentAddOns(); - getGpaEmpPolicyDetails(empPrimaryId); - getGmcEmpPolicyDetails(empPrimaryId); primarySummary(); } else { // Token is empty or null, handle accordingly (e.g., navigate to login screen) @@ -332,12 +341,12 @@ class _empReviewDetailsState extends State { setState(() { gpaDataIsEmpty = 0; }); - ToastHelper.showWarningToast(context, 'No data found'); + // ToastHelper.showWarningToast(context, 'No data found'); print('No data found in the response'); } } else { // Handle other status messages if needed - ToastHelper.showWarningToast(context, 'Something went wrong'); + // ToastHelper.showWarningToast(context, 'Something went wrong'); print('API request failed with status: ${response['status']}'); } } else { @@ -345,7 +354,7 @@ class _empReviewDetailsState extends State { gpaDataIsEmpty = 0; }); // Handle other status codes - ToastHelper.showErrorToast(context, 'Something went wrong'); + // ToastHelper.showErrorToast(context, 'Something went wrong'); print('Request failed with status: ${response['code']}'); } } catch (e) { @@ -707,1033 +716,142 @@ class _empReviewDetailsState extends State { (gmcMappedFamilyFloaters == [] && gmcMappedFamilyFloaters == null)) { return Scaffold( appBar: CustomAppBar(), - body: SingleChildScrollView( - child: Container( - color: Color(0xFFEFF3F6), - child: Column( - children: [ - Center( - child: Text('No Data Available', - style: GoogleFonts.poppins( - fontSize: 16, - fontWeight: FontWeight.bold, - )), - ) - ], + body: Stack(children: [ + SingleChildScrollView( + child: Container( + color: Color(0xFFEFF3F6), + child: Column( + children: [ + Center( + child: Text('No Data Available', + style: GoogleFonts.poppins( + fontSize: 16, + fontWeight: FontWeight.bold, + )), + ) + ], + ), ), ), - )); + if (isLoading) + Container( + color: Color(0x98FFFCE5), // Semi-transparent background + child: Center( + child: // Your GIF loader widget + Image.asset( + height: 60, + width: 60, + 'assets/nhance-loader.gif'), // Adjust path to your GIF loader + ), + ), + Align( + alignment: Alignment.bottomCenter, + child: Container( + width: double.infinity, // Make the footer full width + child: CustomFooter(), + ), + ), + ])); } else { return Scaffold( - appBar: CustomAppBar(), - body: SingleChildScrollView( - child: Container( - padding: Responsive.isDesktop(context) - ? EdgeInsets.symmetric( - horizontal: MediaQuery.of(context).size.width * - 0.2, // 30% of screen width as horizontal padding - vertical: MediaQuery.of(context).size.height * - 0.03, // 5% of screen height as vertical padding - ) - : EdgeInsets.all(10), - color: Color(0xFFEFF3F6), - child: Column( - children: [ - Card( - elevation: 0, - child: Container( - width: double.infinity, - height: 75, - padding: Responsive.isDesktop(context) - ? EdgeInsets.only( - top: 20, bottom: 20, left: 30, right: 30) - : EdgeInsets.only( - top: 12, - bottom: 12, - left: 10, - right: 10), // Add padding to the container - child: Row( - children: [ - Expanded( - flex: 6, - child: Container( - width: 150, - height: 150, - alignment: Alignment.centerLeft, - child: Image.network( - clientLogo ?? '', - width: 80, // Set the width here - height: 80, // Set the height here - loadingBuilder: (BuildContext context, - Widget child, - ImageChunkEvent? loadingProgress) { - if (loadingProgress == null) return child; - return Center( - child: CircularProgressIndicator( - value: loadingProgress.expectedTotalBytes != - null - ? loadingProgress - .cumulativeBytesLoaded / - loadingProgress.expectedTotalBytes! - : null, - ), - ); - }, - errorBuilder: (BuildContext context, Object error, - StackTrace? stackTrace) { - return Image.asset( - 'assets/Solid_gray.png', // Replace 'default_image.png' with your default image asset path - width: 80, - height: 80, - fit: BoxFit.cover, - ); - }, + appBar: CustomAppBar(), + body: Stack(children: [ + SingleChildScrollView( + child: Container( + padding: Responsive.isDesktop(context) + ? EdgeInsets.symmetric( + horizontal: MediaQuery.of(context).size.width * + 0.2, // 30% of screen width as horizontal padding + vertical: MediaQuery.of(context).size.height * + 0.03, // 5% of screen height as vertical padding + ) + : EdgeInsets.all(10), + color: Color(0xFFEFF3F6), + child: Column( + children: [ + Card( + elevation: 0, + color: Colors.white, + child: Container( + width: double.infinity, + height: 75, + padding: Responsive.isDesktop(context) + ? EdgeInsets.only( + top: 20, bottom: 20, left: 30, right: 30) + : EdgeInsets.only( + top: 12, + bottom: 12, + left: 10, + right: 10), // Add padding to the container + child: Row( + children: [ + Expanded( + flex: 6, + child: Container( + width: 150, + height: 150, + alignment: Alignment.centerLeft, + child: Image.network( + clientLogo ?? '', + width: 80, // Set the width here + height: 80, // Set the height here + loadingBuilder: (BuildContext context, + Widget child, + ImageChunkEvent? loadingProgress) { + if (loadingProgress == null) return child; + return Center( + child: CircularProgressIndicator( + value: loadingProgress + .expectedTotalBytes != + null + ? loadingProgress + .cumulativeBytesLoaded / + loadingProgress + .expectedTotalBytes! + : null, + ), + ); + }, + errorBuilder: (BuildContext context, + Object error, StackTrace? stackTrace) { + return Image.asset( + 'assets/Solid_gray.png', // Replace 'default_image.png' with your default image asset path + width: 80, + height: 80, + fit: BoxFit.cover, + ); + }, + ), + ), ), - ), + Expanded( + flex: 9, + child: Text( + clientName ?? '', + textAlign: TextAlign.right, + style: GoogleFonts.poppins( + fontSize: + Responsive.isDesktop(context) ? 20 : 18, + fontWeight: FontWeight.w600, + ), + ), + ) + ], ), - Expanded( - flex: 9, - child: Text( - clientName ?? '', - textAlign: TextAlign.right, - style: GoogleFonts.poppins( - fontSize: Responsive.isDesktop(context) ? 20 : 18, - fontWeight: FontWeight.w600, - ), - ), - ) - ], + ), ), - ), - ), - SizedBox(height: 16), - Card( - elevation: 0, - child: Container( - width: double.infinity, - padding: Responsive.isDesktop(context) - ? EdgeInsets.all(30) - : EdgeInsets.all(10), // Add padding to the container - child: Column(children: [ - Row( - children: [ - Expanded( - flex: 12, - child: Container( - alignment: Alignment.centerLeft, - child: Column( - mainAxisAlignment: - MainAxisAlignment.start, - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Text( - 'Review', - textAlign: TextAlign.left, - style: GoogleFonts.poppins( - fontSize: - Responsive.isDesktop(context) - ? 20 - : 18, - color: Color(0xFF181818), - fontWeight: FontWeight.w600, - ), - ), - ], - ))), - ], - ), - Row( - children: [ - Expanded( - flex: 6, - child: Container( - alignment: Alignment.centerLeft, - child: Column( - mainAxisAlignment: - MainAxisAlignment.start, - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Text( - 'Total Payable', - textAlign: TextAlign.left, - style: GoogleFonts.poppins( - fontSize: - Responsive.isDesktop(context) - ? 18 - : 16, - color: Color(0xFF181818), - ), - ), - ], - ))), - Expanded( - flex: 6, - child: Container( - alignment: Alignment.centerRight, - child: Column( - mainAxisAlignment: - MainAxisAlignment.start, - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Text( - '₹$totalPayableAmt/Year ', - textAlign: TextAlign.left, - style: GoogleFonts.poppins( - fontSize: - Responsive.isDesktop(context) - ? 22 - : 18, - color: Color(0xFFE26728), - fontWeight: FontWeight.w500, - ), - ), - ], - ))), - ], - ), - ])), - ), - SizedBox(height: 16), - if (gpaPolicies != null && gpaPolicies.length > 0) - Card( + SizedBox(height: 16), + Card( elevation: 0, - child: Padding( - padding: Responsive.isDesktop(context) - ? EdgeInsets.all(30) - : EdgeInsets.all(10), - child: Column( - children: [ - Container( - decoration: BoxDecoration( - color: Color( - 0xFFFFF1DD), // Set background color for the container - borderRadius: BorderRadius.circular( - 5), // Set border radius for the container - ), - padding: Responsive.isDesktop(context) - ? EdgeInsets.only( - top: 15, bottom: 15, left: 25, right: 25) - : EdgeInsets.only( - top: 10, bottom: 10, left: 10, right: 10), - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Expanded( - flex: 8, - child: Container( - alignment: Alignment.centerLeft, - child: Column( - mainAxisAlignment: - MainAxisAlignment.start, - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Text( - gpaPolicyName ?? '', - textAlign: TextAlign.left, - style: GoogleFonts.poppins( - fontSize: - Responsive.isDesktop( - context) - ? 18 - : 14, - ), - ), - Row( - children: [ - Text( - 'Group Personal Accident Coverage', - textAlign: TextAlign.left, - style: GoogleFonts.poppins( - fontSize: - Responsive.isDesktop( - context) - ? 20 - : 16, - fontWeight: - FontWeight.w600, - ), - ), - if (gpaECardDownload != null) - GestureDetector( - onTap: () async { - // Convert the URL string to a Uri object - Uri uri = Uri.parse( - gpaECardDownload); - - // Check if the URL is valid - if (await canLaunchUrl( - uri)) { - // Open the URL in the default browser - await launchUrl(uri); - } else { - // Handle the case where the URL cannot be launched - print( - 'Could not launch $gpaECardDownload'); - } - }, - child: MouseRegion( - cursor: - SystemMouseCursors - .click, - child: Icon( - Icons.file_download, - color: - Color(0xFFE26728), - size: 25, - ), - ), - ), - ], - ), - ], - ))), - Expanded( - flex: 4, - child: Container( - alignment: Alignment.centerRight, - child: Column( - mainAxisAlignment: - MainAxisAlignment.end, - crossAxisAlignment: - CrossAxisAlignment.end, - children: [ - Text( - 'Sum Insured', - textAlign: TextAlign.right, - style: GoogleFonts.poppins( - fontSize: - Responsive.isDesktop( - context) - ? 18 - : 14, - ), - ), - Text( - '₹ ${gpasumInsured != null ? gpasumInsured : 'NA'}', - textAlign: TextAlign.right, - style: GoogleFonts.poppins( - fontSize: - Responsive.isDesktop( - context) - ? 20 - : 16, - fontWeight: FontWeight.w600, - ), - ), - ], - ))), - ], - ), - ), - SizedBox(height: 15), - Container( - padding: Responsive.isDesktop(context) - ? EdgeInsets.only( - top: 0, bottom: 0, left: 15, right: 15) - : EdgeInsets.only( - top: 0, bottom: 0, left: 5, right: 5), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Icon(Icons.arrow_right, - color: - Color(0xFFE26728)), // Arrow icon - SizedBox( - width: Responsive.isDesktop(context) - ? 10 - : 5), // Space between icon and text - Expanded( - child: Text( - gpaSelfDetails ?? '', - style: GoogleFonts.poppins( - fontSize: - Responsive.isDesktop(context) - ? 18 - : 16, - color: Color(0xFF232526), - ), - ), - ), - ], - ), - ], - ), - ), - ], - ), - )), - SizedBox(height: 16), - if (gmcPolicies != null && gmcPolicies.length > 0) - Column( - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - ...generateGmcCards(gmcPolicies), - ], - ), - SizedBox(height: 16), - if (showHideTopUpCard == 1) - Card( - elevation: 0, - child: Padding( - padding: Responsive.isDesktop(context) - ? EdgeInsets.all(30) - : EdgeInsets.all(10), - child: Column( - children: [ - Container( - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Expanded( - flex: 12, - child: Container( - alignment: Alignment.centerLeft, - child: Column( - mainAxisAlignment: - MainAxisAlignment.start, - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Text( - 'Add Ons', - textAlign: TextAlign.left, - style: GoogleFonts.poppins( - fontSize: - Responsive.isDesktop( - context) - ? 18 - : 16, - color: Color(0xFF181818), - fontWeight: FontWeight.w600, - ), - ), - ], - ))), - ], - ), - ), - SizedBox(height: 15), - Container( - decoration: BoxDecoration( - color: Color( - 0xFFFFF1DD), // Set background color for the container - borderRadius: BorderRadius.circular( - 5), // Set border radius for the container - ), - padding: Responsive.isDesktop(context) - ? EdgeInsets.only( - top: 15, bottom: 15, left: 25, right: 25) - : EdgeInsets.only( - top: 10, bottom: 10, left: 10, right: 10), - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Expanded( - flex: 8, - child: Container( - alignment: Alignment.centerLeft, - child: Column( - mainAxisAlignment: - MainAxisAlignment.start, - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Text( - topUpPolicyName ?? '', - textAlign: TextAlign.left, - style: GoogleFonts.poppins( - fontSize: - Responsive.isDesktop( - context) - ? 18 - : 14, - ), - ), - Row( - children: [ - Text( - 'Group Medical Coverage - Top Up', - textAlign: TextAlign.left, - style: GoogleFonts.poppins( - fontSize: - Responsive.isDesktop( - context) - ? 20 - : 16, - fontWeight: - FontWeight.w600, - ), - ), - if (topUpECardDownload != - null) - GestureDetector( - onTap: () async { - // Convert the URL string to a Uri object - Uri uri = Uri.parse( - topUpECardDownload); - - // Check if the URL is valid - if (await canLaunchUrl( - uri)) { - // Open the URL in the default browser - await launchUrl(uri); - } else { - // Handle the case where the URL cannot be launched - print( - 'Could not launch $topUpECardDownload'); - } - }, - child: MouseRegion( - cursor: - SystemMouseCursors - .click, - child: Icon( - Icons.file_download, - color: - Color(0xFFE26728), - size: 25, - ), - ), - ), - ], - ), - ], - ))), - Expanded( - flex: 4, - child: Container( - alignment: Alignment.centerRight, - child: Column( - mainAxisAlignment: - MainAxisAlignment.end, - crossAxisAlignment: - CrossAxisAlignment.end, - children: [ - Text( - topUpFloaterTextHeading ?? '', - textAlign: TextAlign.right, - style: GoogleFonts.poppins( - fontSize: - Responsive.isDesktop( - context) - ? 18 - : 14, - ), - ), - Text( - '₹ ${topUpSumInsured != null ? topUpSumInsured : 'NA'}', - textAlign: TextAlign.right, - style: GoogleFonts.poppins( - fontSize: - Responsive.isDesktop( - context) - ? 20 - : 16, - fontWeight: FontWeight.w600, - ), - ), - ], - ))), - ], - ), - ), - SizedBox(height: 15), - Container( - padding: Responsive.isDesktop(context) - ? EdgeInsets.only( - top: 0, bottom: 0, left: 15, right: 15) - : EdgeInsets.only( - top: 0, bottom: 0, left: 5, right: 5), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: topUpMappedFamilyFloatersSiArray - .where((item) => - item['is_value_exist'] == true) - .map((item) { - Map data = item['data']; - String formattedDate = - formatDate(data['dob']); - return Row( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Icon(Icons.arrow_right, - color: - Color(0xFFE26728)), // Arrow icon - SizedBox( - width: Responsive.isDesktop(context) - ? 10 - : 5), // Space between icon and text - Expanded( - child: Text( - '${data['name']} ~ ${data['relationship']} ~ DOB : $formattedDate', - style: GoogleFonts.poppins( - fontSize: - Responsive.isDesktop(context) - ? 18 - : 16, - color: Color(0xFF232526), - ), - ), - ), - ], - ); - }).toList(), - ), - ), - ], - ), - )), - SizedBox(height: showHideTopUpCard == 1 ? 16 : 0), - if (showHideTopUpParentCard == 1) - Card( - elevation: 0, - child: Padding( - padding: Responsive.isDesktop(context) - ? EdgeInsets.all(30) - : EdgeInsets.all(10), - child: Column( - children: [ - Container( - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Expanded( - flex: 12, - child: Container( - alignment: Alignment.centerLeft, - child: Column( - mainAxisAlignment: - MainAxisAlignment.start, - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Text( - 'Add Ons', - textAlign: TextAlign.left, - style: GoogleFonts.poppins( - fontSize: - Responsive.isDesktop( - context) - ? 18 - : 16, - color: Color(0xFF181818), - fontWeight: FontWeight.w600, - ), - ), - ], - ))), - ], - ), - ), - SizedBox(height: 15), - Container( - decoration: BoxDecoration( - color: Color( - 0xFFFFF1DD), // Set background color for the container - borderRadius: BorderRadius.circular( - 5), // Set border radius for the container - ), - padding: Responsive.isDesktop(context) - ? EdgeInsets.only( - top: 15, bottom: 15, left: 25, right: 25) - : EdgeInsets.only( - top: 10, bottom: 10, left: 10, right: 10), - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Expanded( - flex: 8, - child: Container( - alignment: Alignment.centerLeft, - child: Column( - mainAxisAlignment: - MainAxisAlignment.start, - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Text( - topUpParentPolicyName ?? '', - textAlign: TextAlign.left, - style: GoogleFonts.poppins( - fontSize: - Responsive.isDesktop( - context) - ? 18 - : 14, - ), - ), - Row( - children: [ - Text( - topUpParentTypeName ?? '', - textAlign: TextAlign.left, - style: GoogleFonts.poppins( - fontSize: - Responsive.isDesktop( - context) - ? 20 - : 16, - fontWeight: - FontWeight.w600, - ), - ), - if (topUpParentECardDownload != - null) - GestureDetector( - onTap: () async { - // Convert the URL string to a Uri object - Uri uri = Uri.parse( - topUpParentECardDownload); - - // Check if the URL is valid - if (await canLaunchUrl( - uri)) { - // Open the URL in the default browser - await launchUrl(uri); - } else { - // Handle the case where the URL cannot be launched - print( - 'Could not launch $topUpParentECardDownload'); - } - }, - child: MouseRegion( - cursor: - SystemMouseCursors - .click, - child: Icon( - Icons.file_download, - color: - Color(0xFFE26728), - size: 25, - ), - ), - ), - ], - ), - ], - ))), - Expanded( - flex: 4, - child: Container( - alignment: Alignment.centerRight, - child: Column( - mainAxisAlignment: - MainAxisAlignment.end, - crossAxisAlignment: - CrossAxisAlignment.end, - children: [ - Text( - topUpParentFloterTextHeading ?? - '', - textAlign: TextAlign.right, - style: GoogleFonts.poppins( - fontSize: - Responsive.isDesktop( - context) - ? 18 - : 14, - ), - ), - Text( - '₹ ${topUpParentSiValue != null ? topUpParentSiValue : 'NA'}', - textAlign: TextAlign.right, - style: GoogleFonts.poppins( - fontSize: - Responsive.isDesktop( - context) - ? 20 - : 16, - fontWeight: FontWeight.w600, - ), - ), - ], - ))), - ], - ), - ), - SizedBox(height: 15), - Container( - padding: Responsive.isDesktop(context) - ? EdgeInsets.only( - top: 0, bottom: 0, left: 15, right: 15) - : EdgeInsets.only( - top: 0, bottom: 0, left: 5, right: 5), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: topUpParentMappedFamilyFloatersSi - .where((item) => - item['is_value_exist'] == true) - .map((item) { - Map data = item['data']; - String formattedDate = - formatDate(data['dob']); - return Row( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Icon(Icons.arrow_right, - color: - Color(0xFFE26728)), // Arrow icon - SizedBox( - width: Responsive.isDesktop(context) - ? 10 - : 5), // Space between icon and text - Expanded( - child: Text( - '${data['name']} ~ ${data['relationship']} ~ DOB : $formattedDate', - style: GoogleFonts.poppins( - fontSize: - Responsive.isDesktop(context) - ? 18 - : 16, - color: Color(0xFF232526), - ), - ), - ), - ], - ); - }).toList(), - ), - ), - ], - ), - )), - SizedBox(height: showHideTopUpCard == 1 ? 16 : 0), - if (showHideAddOnsCard == 1) - Card( - elevation: 0, - child: Padding( - padding: Responsive.isDesktop(context) - ? EdgeInsets.all(30) - : EdgeInsets.all(10), - child: Column( - children: [ - Container( - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Expanded( - flex: 12, - child: Container( - alignment: Alignment.centerLeft, - child: Column( - mainAxisAlignment: - MainAxisAlignment.start, - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Text( - 'Add Ons', - textAlign: TextAlign.left, - style: GoogleFonts.poppins( - fontSize: - Responsive.isDesktop( - context) - ? 18 - : 16, - color: Color(0xFF181818), - fontWeight: FontWeight.w600, - ), - ), - ], - ))), - ], - ), - ), - SizedBox(height: 15), - Container( - decoration: BoxDecoration( - color: Color( - 0xFFFFF1DD), // Set background color for the container - borderRadius: BorderRadius.circular( - 5), // Set border radius for the container - ), - padding: Responsive.isDesktop(context) - ? EdgeInsets.only( - top: 15, bottom: 15, left: 25, right: 25) - : EdgeInsets.only( - top: 10, bottom: 10, left: 10, right: 10), - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Expanded( - flex: - Responsive.isDesktop(context) ? 9 : 8, - child: Container( - alignment: Alignment.centerLeft, - child: Column( - mainAxisAlignment: - MainAxisAlignment.start, - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Text( - addOnsDependentPolicyName ?? '', - textAlign: TextAlign.left, - style: GoogleFonts.poppins( - fontSize: - Responsive.isDesktop( - context) - ? 18 - : 14, - ), - ), - Row( - children: [ - Text( - 'Group Medical Coverage - Dependent AddOns', - textAlign: TextAlign.left, - style: GoogleFonts.poppins( - fontSize: - Responsive.isDesktop( - context) - ? 20 - : 16, - fontWeight: - FontWeight.w600, - ), - ), - if (addOnsDependentECardDownload != - null) - GestureDetector( - onTap: () async { - // Convert the URL string to a Uri object - Uri uri = Uri.parse( - addOnsDependentECardDownload); - - // Check if the URL is valid - if (await canLaunchUrl( - uri)) { - // Open the URL in the default browser - await launchUrl(uri); - } else { - // Handle the case where the URL cannot be launched - print( - 'Could not launch $addOnsDependentECardDownload'); - } - }, - child: MouseRegion( - cursor: - SystemMouseCursors - .click, - child: Icon( - Icons.file_download, - color: - Color(0xFFE26728), - size: 25, - ), - ), - ), - ], - ), - ], - ))), - Expanded( - flex: - Responsive.isDesktop(context) ? 3 : 4, - child: Container( - alignment: Alignment.centerRight, - child: Column( - mainAxisAlignment: - MainAxisAlignment.end, - crossAxisAlignment: - CrossAxisAlignment.end, - children: [ - Text( - addOnsFloaterTextHeading ?? '', - textAlign: TextAlign.right, - style: GoogleFonts.poppins( - fontSize: - Responsive.isDesktop( - context) - ? 18 - : 14, - ), - ), - Text( - '₹ ${addOnsDependentSumInsured != null ? addOnsDependentSumInsured : 'NA'}', - textAlign: TextAlign.right, - style: GoogleFonts.poppins( - fontSize: - Responsive.isDesktop( - context) - ? 20 - : 16, - fontWeight: FontWeight.w600, - ), - ), - ], - ))), - ], - ), - ), - SizedBox(height: 15), - Container( - padding: Responsive.isDesktop(context) - ? EdgeInsets.only( - top: 0, bottom: 0, left: 15, right: 15) - : EdgeInsets.only( - top: 0, bottom: 0, left: 5, right: 5), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: - addOnsDependentMappedFamilyFloatersArray - .where((item) => - item['is_value_exist'] == true) - .map((item) { - Map data = item['data']; - return Row( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Icon(Icons.arrow_right, - color: - Color(0xFFE26728)), // Arrow icon - SizedBox( - width: Responsive.isDesktop(context) - ? 10 - : 5), // Space between icon and text - Expanded( - child: Text( - '${data['name']} - ${data['relationship']} - ${data['dob']}', - style: GoogleFonts.poppins( - fontSize: - Responsive.isDesktop(context) - ? 18 - : 16, - color: Color(0xFF232526), - ), - ), - ), - ], - ); - }).toList(), - ), - ), - ], - ), - )), - SizedBox(height: showHideAddOnsCard == 1 ? 16 : 0), - Card( - elevation: 0, - child: Padding( - padding: Responsive.isDesktop(context) - ? EdgeInsets.all(30) - : EdgeInsets.all(10), - child: Column( - children: [ - Container( - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, + color: Colors.white, + child: Container( + width: double.infinity, + padding: Responsive.isDesktop(context) + ? EdgeInsets.all(30) + : EdgeInsets.all( + 10), // Add padding to the container + child: Column(children: [ + Row( children: [ Expanded( flex: 12, @@ -1746,13 +864,13 @@ class _empReviewDetailsState extends State { CrossAxisAlignment.start, children: [ Text( - 'Premium Summary', + 'Review', textAlign: TextAlign.left, style: GoogleFonts.poppins( fontSize: Responsive.isDesktop( context) - ? 18 - : 16, + ? 20 + : 18, color: Color(0xFF181818), fontWeight: FontWeight.w600, ), @@ -1761,364 +879,7 @@ class _empReviewDetailsState extends State { ))), ], ), - ), - SizedBox(height: 15), - Container( - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Expanded( - flex: 12, - child: Container( - alignment: Alignment - .centerLeft, // Adjust padding as needed - child: Table( - columnWidths: { - 0: FlexColumnWidth( - 2), // Adjust column width as needed - 1: FlexColumnWidth(2), - 2: FlexColumnWidth( - 2), // Adjust column width as needed - 3: FlexColumnWidth(2), - }, - children: [ - TableRow( - children: [ - TableCell( - child: Padding( - padding: EdgeInsets.all(8.0), - child: Text( - 'Policy ', - textAlign: TextAlign.start, - style: GoogleFonts.poppins( - fontSize: Responsive - .isDesktop( - context) - ? 16 - : 14, - fontWeight: - FontWeight.bold), - ), - ), - ), - TableCell( - child: Padding( - padding: EdgeInsets.all(8.0), - child: Text( - 'Additional Premium', - textAlign: TextAlign.start, - style: GoogleFonts.poppins( - fontSize: Responsive - .isDesktop( - context) - ? 16 - : 14, - fontWeight: - FontWeight.bold), - ), - ), - ), - TableCell( - child: Padding( - padding: EdgeInsets.all(8.0), - child: Text( - 'GST', - textAlign: TextAlign.start, - style: GoogleFonts.poppins( - fontSize: Responsive - .isDesktop( - context) - ? 16 - : 14, - fontWeight: - FontWeight.bold), - ), - ), - ), - TableCell( - child: Padding( - padding: EdgeInsets.all(8.0), - child: Text( - 'Total', - textAlign: TextAlign.start, - style: GoogleFonts.poppins( - fontSize: Responsive - .isDesktop( - context) - ? 16 - : 14, - fontWeight: - FontWeight.bold), - ), - ), - ), - ], - ), - if (activeSiData == 1) - TableRow( - children: [ - TableCell( - child: Padding( - padding: - EdgeInsets.all(8.0), - child: Text( - Responsive.isDesktop( - context) - ? topUpTypeName - : 'GMC - Top Up', - textAlign: - TextAlign.start, - style: GoogleFonts.poppins( - fontSize: Responsive - .isDesktop( - context) - ? 14 - : 12), - ), - ), - ), - TableCell( - child: Padding( - padding: - EdgeInsets.all(8.0), - child: Text( - '₹$topUpSiPremiumValue/Year', - textAlign: - Responsive.isDesktop( - context) - ? TextAlign.start - : TextAlign.start, - style: GoogleFonts.poppins( - fontSize: Responsive - .isDesktop( - context) - ? 14 - : 12), - ), - ), - ), - TableCell( - child: Padding( - padding: - EdgeInsets.all(8.0), - child: Text( - '₹$topUpSiPremiumGst/-', - textAlign: - Responsive.isDesktop( - context) - ? TextAlign.start - : TextAlign.start, - style: GoogleFonts.poppins( - fontSize: Responsive - .isDesktop( - context) - ? 14 - : 12), - ), - ), - ), - TableCell( - child: Padding( - padding: - EdgeInsets.all(8.0), - child: Text( - '₹$topUpSiTotalAmt/Year', - textAlign: - Responsive.isDesktop( - context) - ? TextAlign.start - : TextAlign.start, - style: GoogleFonts.poppins( - fontSize: Responsive - .isDesktop( - context) - ? 14 - : 12), - ), - ), - ), - ], - ), - if (activeSiParentData == 1) - TableRow( - children: [ - TableCell( - child: Padding( - padding: - EdgeInsets.all(8.0), - child: Text( - Responsive.isDesktop( - context) - ? topUpParentTypeName - : 'GMC - Parents Top Up', - textAlign: - TextAlign.start, - style: GoogleFonts.poppins( - fontSize: Responsive - .isDesktop( - context) - ? 14 - : 12), - ), - ), - ), - TableCell( - child: Padding( - padding: - EdgeInsets.all(8.0), - child: Text( - '₹$topUpParentSiPremiumValue/Year', - textAlign: - Responsive.isDesktop( - context) - ? TextAlign.start - : TextAlign.start, - style: GoogleFonts.poppins( - fontSize: Responsive - .isDesktop( - context) - ? 14 - : 12), - ), - ), - ), - TableCell( - child: Padding( - padding: - EdgeInsets.all(8.0), - child: Text( - '₹$topUpParentSiPremiumGst/-', - textAlign: - Responsive.isDesktop( - context) - ? TextAlign.start - : TextAlign.start, - style: GoogleFonts.poppins( - fontSize: Responsive - .isDesktop( - context) - ? 14 - : 12), - ), - ), - ), - TableCell( - child: Padding( - padding: - EdgeInsets.all(8.0), - child: Text( - '₹$topUpParentSiTotalAmt/Year', - textAlign: - Responsive.isDesktop( - context) - ? TextAlign.start - : TextAlign.start, - style: GoogleFonts.poppins( - fontSize: Responsive - .isDesktop( - context) - ? 14 - : 12), - ), - ), - ), - ], - ), - if (activeDependentData == 1) - TableRow( - children: [ - TableCell( - child: Padding( - padding: - EdgeInsets.all(8.0), - child: Text( - Responsive.isDesktop( - context) - ? 'Group Medical Coverage - Add Dependent' - : 'GMC - Dependent ', - textAlign: - TextAlign.start, - style: GoogleFonts.poppins( - fontSize: Responsive - .isDesktop( - context) - ? 14 - : 12), - ), - ), - ), - TableCell( - child: Padding( - padding: - EdgeInsets.all(8.0), - child: Text( - '₹$addOnDependentPremiumValue/Year', - textAlign: - Responsive.isDesktop( - context) - ? TextAlign.start - : TextAlign.start, - style: GoogleFonts.poppins( - fontSize: Responsive - .isDesktop( - context) - ? 14 - : 12), - ), - ), - ), - TableCell( - child: Padding( - padding: - EdgeInsets.all(8.0), - child: Text( - '₹$addOnsDependentPremiumGst/-', - textAlign: - Responsive.isDesktop( - context) - ? TextAlign.start - : TextAlign.start, - style: GoogleFonts.poppins( - fontSize: Responsive - .isDesktop( - context) - ? 14 - : 12), - ), - ), - ), - TableCell( - child: Padding( - padding: - EdgeInsets.all(8.0), - child: Text( - '₹$addOnsDependentTotalAmt/Year', - textAlign: - Responsive.isDesktop( - context) - ? TextAlign.start - : TextAlign.start, - style: GoogleFonts.poppins( - fontSize: Responsive - .isDesktop( - context) - ? 14 - : 12), - ), - ), - ), - ], - ), - ], - ), - )) - ], - ), - ), - SizedBox(height: 10), - Container( - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, + Row( children: [ Expanded( flex: 6, @@ -2136,10 +897,9 @@ class _empReviewDetailsState extends State { style: GoogleFonts.poppins( fontSize: Responsive.isDesktop( context) - ? 20 + ? 18 : 16, color: Color(0xFF181818), - fontWeight: FontWeight.w600, ), ), ], @@ -2148,159 +908,1559 @@ class _empReviewDetailsState extends State { flex: 6, child: Container( alignment: Alignment.centerRight, - child: Column( - mainAxisAlignment: - MainAxisAlignment.end, - crossAxisAlignment: - CrossAxisAlignment.end, - children: [ - Text( - '₹$totalPayableAmt/Year', - textAlign: TextAlign.right, - style: GoogleFonts.poppins( - fontSize: Responsive.isDesktop( - context) - ? 18 - : 16, - color: Color(0xFFE26728), - fontWeight: FontWeight.w500, - ), - ), - ], - ))) - ], - ), - ), - SizedBox(height: 15), - Container( - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Expanded( - flex: 1, - child: Container( - alignment: Alignment.centerLeft, child: Column( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Checkbox( - value: isChecked, - onChanged: (bool? value) { - setState(() { - isChecked = value!; - }); - }, - activeColor: Color(0xFFE26728), - ), - ], - ))), - Expanded( - flex: 11, - child: Container( - alignment: Alignment.centerRight, - child: Column( - mainAxisAlignment: - MainAxisAlignment.end, - crossAxisAlignment: - CrossAxisAlignment.end, children: [ Text( - 'I declare that the information I have provided is true and accurate to the best of my knowledge', - textAlign: - Responsive.isDesktop(context) - ? TextAlign.left - : TextAlign.start, + '₹$totalPayableAmt/Year ', + textAlign: TextAlign.left, style: GoogleFonts.poppins( fontSize: Responsive.isDesktop( context) - ? 18 - : 15, - color: Color(0xFF292929), + ? 22 + : 18, + color: Color(0xFFE26728), + fontWeight: FontWeight.w500, ), ), ], ))), ], ), - ), - SizedBox( - height: Responsive.isDesktop(context) ? 15 : 0), - Container( - child: Row( + ])), + ), + SizedBox(height: 16), + if (gpaPolicies != null && gpaPolicies.length > 0) + Card( + elevation: 0, + child: Padding( + padding: Responsive.isDesktop(context) + ? EdgeInsets.all(30) + : EdgeInsets.all(10), + child: Column( children: [ - Expanded( - flex: 6, - child: Container( - width: 150, - height: Responsive.isDesktop(context) - ? 150 - : 100, - alignment: Alignment.centerLeft, - child: ElevatedButton( - onPressed: () async { - // Remove siData, siParentData, and dependentData from local storage - final SharedPreferences prefs = - await SharedPreferences - .getInstance(); - prefs.remove('siData'); - prefs.remove('siParentData'); - prefs.remove('dependentData'); - Navigator.pushNamed( - context, 'addOnsDetails'); - }, - child: Text( - 'Back', - style: GoogleFonts.poppins( - color: Color(0xFFE26728)), - ), - style: ElevatedButton.styleFrom( - backgroundColor: Colors.white, - shape: RoundedRectangleBorder( - borderRadius: - BorderRadius.circular(5), - side: BorderSide( - color: Color(0xFFE26728)), + Container( + decoration: BoxDecoration( + color: Color( + 0xFFFFF1DD), // Set background color for the container + borderRadius: BorderRadius.circular( + 5), // Set border radius for the container + ), + padding: Responsive.isDesktop(context) + ? EdgeInsets.only( + top: 15, + bottom: 15, + left: 25, + right: 25) + : EdgeInsets.only( + top: 10, + bottom: 10, + left: 10, + right: 10), + child: Row( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Expanded( + flex: 8, + child: Container( + alignment: Alignment.centerLeft, + child: Column( + mainAxisAlignment: + MainAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Text( + gpaPolicyName ?? '', + textAlign: TextAlign.left, + style: GoogleFonts.poppins( + fontSize: + Responsive.isDesktop( + context) + ? 18 + : 14, + ), + ), + Row( + children: [ + Text( + 'Group Personal Accident Coverage', + textAlign: + TextAlign.left, + style: + GoogleFonts.poppins( + fontSize: Responsive + .isDesktop( + context) + ? 20 + : 16, + fontWeight: + FontWeight.w600, + ), + ), + if (gpaECardDownload != + null) + GestureDetector( + onTap: () async { + // Convert the URL string to a Uri object + Uri uri = Uri.parse( + gpaECardDownload); + + // Check if the URL is valid + if (await canLaunchUrl( + uri)) { + // Open the URL in the default browser + await launchUrl( + uri); + } else { + // Handle the case where the URL cannot be launched + print( + 'Could not launch $gpaECardDownload'); + } + }, + child: MouseRegion( + cursor: + SystemMouseCursors + .click, + child: Icon( + Icons + .file_download, + color: Color( + 0xFFE26728), + size: 25, + ), + ), + ), + ], + ), + ], + ))), + Expanded( + flex: 4, + child: Container( + alignment: Alignment.centerRight, + child: Column( + mainAxisAlignment: + MainAxisAlignment.end, + crossAxisAlignment: + CrossAxisAlignment.end, + children: [ + Text( + 'Sum Insured', + textAlign: TextAlign.right, + style: GoogleFonts.poppins( + fontSize: + Responsive.isDesktop( + context) + ? 18 + : 14, + ), + ), + Text( + '₹ ${gpasumInsured != null ? gpasumInsured : 'NA'}', + textAlign: TextAlign.right, + style: GoogleFonts.poppins( + fontSize: + Responsive.isDesktop( + context) + ? 20 + : 16, + fontWeight: + FontWeight.w600, + ), + ), + ], + ))), + ], + ), + ), + SizedBox(height: 15), + Container( + padding: Responsive.isDesktop(context) + ? EdgeInsets.only( + top: 0, + bottom: 0, + left: 15, + right: 15) + : EdgeInsets.only( + top: 0, bottom: 0, left: 5, right: 5), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Row( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Icon(Icons.arrow_right, + color: Color( + 0xFFE26728)), // Arrow icon + SizedBox( + width: Responsive.isDesktop( + context) + ? 10 + : 5), // Space between icon and text + Expanded( + child: Text( + gpaSelfDetails ?? '', + style: GoogleFonts.poppins( + fontSize: Responsive.isDesktop( + context) + ? 18 + : 16, + color: Color(0xFF232526), + ), + ), ), - ), + ], ), - )), - Expanded( - flex: 6, - child: Container( - width: 150, - height: 150, - alignment: Alignment.centerRight, - child: ElevatedButton( - onPressed: - isChecked ? sendAddOnAPI : null, - child: Text( - 'Submit', - style: GoogleFonts.poppins( - color: Colors.white), - ), - style: ElevatedButton.styleFrom( - backgroundColor: Color(0xFFE26728), - shape: RoundedRectangleBorder( - borderRadius: - BorderRadius.circular(5), - ), - ), - ), - )), + ], + ), + ), ], ), - ), + )), + SizedBox(height: 16), + if (gmcPolicies != null && gmcPolicies.length > 0) + Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + ...generateGmcCards(gmcPolicies), ], ), - )), - ], + SizedBox(height: 16), + if (showHideTopUpCard == 1) + Card( + elevation: 0, + color: Colors.white, + child: Padding( + padding: Responsive.isDesktop(context) + ? EdgeInsets.all(30) + : EdgeInsets.all(10), + child: Column( + children: [ + Container( + child: Row( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Expanded( + flex: 12, + child: Container( + alignment: Alignment.centerLeft, + child: Column( + mainAxisAlignment: + MainAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Text( + 'Add Ons', + textAlign: TextAlign.left, + style: GoogleFonts.poppins( + fontSize: + Responsive.isDesktop( + context) + ? 18 + : 16, + color: Color(0xFF181818), + fontWeight: + FontWeight.w600, + ), + ), + ], + ))), + ], + ), + ), + SizedBox(height: 15), + Container( + decoration: BoxDecoration( + color: Color( + 0xFFFFF1DD), // Set background color for the container + borderRadius: BorderRadius.circular( + 5), // Set border radius for the container + ), + padding: Responsive.isDesktop(context) + ? EdgeInsets.only( + top: 15, + bottom: 15, + left: 25, + right: 25) + : EdgeInsets.only( + top: 10, + bottom: 10, + left: 10, + right: 10), + child: Row( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Expanded( + flex: 8, + child: Container( + alignment: Alignment.centerLeft, + child: Column( + mainAxisAlignment: + MainAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Text( + topUpPolicyName ?? '', + textAlign: TextAlign.left, + style: GoogleFonts.poppins( + fontSize: + Responsive.isDesktop( + context) + ? 18 + : 14, + ), + ), + Row( + children: [ + Text( + 'Group Medical Coverage - Top Up', + textAlign: + TextAlign.left, + style: + GoogleFonts.poppins( + fontSize: Responsive + .isDesktop( + context) + ? 20 + : 16, + fontWeight: + FontWeight.w600, + ), + ), + if (topUpECardDownload != + null) + GestureDetector( + onTap: () async { + // Convert the URL string to a Uri object + Uri uri = Uri.parse( + topUpECardDownload); + + // Check if the URL is valid + if (await canLaunchUrl( + uri)) { + // Open the URL in the default browser + await launchUrl( + uri); + } else { + // Handle the case where the URL cannot be launched + print( + 'Could not launch $topUpECardDownload'); + } + }, + child: MouseRegion( + cursor: + SystemMouseCursors + .click, + child: Icon( + Icons + .file_download, + color: Color( + 0xFFE26728), + size: 25, + ), + ), + ), + ], + ), + ], + ))), + Expanded( + flex: 4, + child: Container( + alignment: Alignment.centerRight, + child: Column( + mainAxisAlignment: + MainAxisAlignment.end, + crossAxisAlignment: + CrossAxisAlignment.end, + children: [ + Text( + topUpFloaterTextHeading ?? + '', + textAlign: TextAlign.right, + style: GoogleFonts.poppins( + fontSize: + Responsive.isDesktop( + context) + ? 18 + : 14, + ), + ), + Text( + '₹ ${topUpSumInsured != null ? topUpSumInsured : 'NA'}', + textAlign: TextAlign.right, + style: GoogleFonts.poppins( + fontSize: + Responsive.isDesktop( + context) + ? 20 + : 16, + fontWeight: + FontWeight.w600, + ), + ), + ], + ))), + ], + ), + ), + SizedBox(height: 15), + Container( + padding: Responsive.isDesktop(context) + ? EdgeInsets.only( + top: 0, + bottom: 0, + left: 15, + right: 15) + : EdgeInsets.only( + top: 0, bottom: 0, left: 5, right: 5), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: topUpMappedFamilyFloatersSiArray + .where((item) => + item['is_value_exist'] == true) + .map((item) { + Map data = item['data']; + String formattedDate = + formatDate(data['dob']); + return Row( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Icon(Icons.arrow_right, + color: Color( + 0xFFE26728)), // Arrow icon + SizedBox( + width: Responsive.isDesktop( + context) + ? 10 + : 5), // Space between icon and text + Expanded( + child: Text( + '${data['name']} ~ ${data['relationship']} ~ DOB : $formattedDate', + style: GoogleFonts.poppins( + fontSize: Responsive.isDesktop( + context) + ? 18 + : 16, + color: Color(0xFF232526), + ), + ), + ), + ], + ); + }).toList(), + ), + ), + ], + ), + )), + SizedBox(height: showHideTopUpCard == 1 ? 16 : 0), + if (showHideTopUpParentCard == 1) + Card( + elevation: 0, + color: Colors.white, + child: Padding( + padding: Responsive.isDesktop(context) + ? EdgeInsets.all(30) + : EdgeInsets.all(10), + child: Column( + children: [ + Container( + child: Row( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Expanded( + flex: 12, + child: Container( + alignment: Alignment.centerLeft, + child: Column( + mainAxisAlignment: + MainAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Text( + 'Add Ons', + textAlign: TextAlign.left, + style: GoogleFonts.poppins( + fontSize: + Responsive.isDesktop( + context) + ? 18 + : 16, + color: Color(0xFF181818), + fontWeight: + FontWeight.w600, + ), + ), + ], + ))), + ], + ), + ), + SizedBox(height: 15), + Container( + decoration: BoxDecoration( + color: Color( + 0xFFFFF1DD), // Set background color for the container + borderRadius: BorderRadius.circular( + 5), // Set border radius for the container + ), + padding: Responsive.isDesktop(context) + ? EdgeInsets.only( + top: 15, + bottom: 15, + left: 25, + right: 25) + : EdgeInsets.only( + top: 10, + bottom: 10, + left: 10, + right: 10), + child: Row( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Expanded( + flex: 8, + child: Container( + alignment: Alignment.centerLeft, + child: Column( + mainAxisAlignment: + MainAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Text( + topUpParentPolicyName ?? '', + textAlign: TextAlign.left, + style: GoogleFonts.poppins( + fontSize: + Responsive.isDesktop( + context) + ? 18 + : 14, + ), + ), + Row( + children: [ + Text( + topUpParentTypeName ?? + '', + textAlign: + TextAlign.left, + style: + GoogleFonts.poppins( + fontSize: Responsive + .isDesktop( + context) + ? 20 + : 16, + fontWeight: + FontWeight.w600, + ), + ), + if (topUpParentECardDownload != + null) + GestureDetector( + onTap: () async { + // Convert the URL string to a Uri object + Uri uri = Uri.parse( + topUpParentECardDownload); + + // Check if the URL is valid + if (await canLaunchUrl( + uri)) { + // Open the URL in the default browser + await launchUrl( + uri); + } else { + // Handle the case where the URL cannot be launched + print( + 'Could not launch $topUpParentECardDownload'); + } + }, + child: MouseRegion( + cursor: + SystemMouseCursors + .click, + child: Icon( + Icons + .file_download, + color: Color( + 0xFFE26728), + size: 25, + ), + ), + ), + ], + ), + ], + ))), + Expanded( + flex: 4, + child: Container( + alignment: Alignment.centerRight, + child: Column( + mainAxisAlignment: + MainAxisAlignment.end, + crossAxisAlignment: + CrossAxisAlignment.end, + children: [ + Text( + topUpParentFloterTextHeading ?? + '', + textAlign: TextAlign.right, + style: GoogleFonts.poppins( + fontSize: + Responsive.isDesktop( + context) + ? 18 + : 14, + ), + ), + Text( + '₹ ${topUpParentSiValue != null ? topUpParentSiValue : 'NA'}', + textAlign: TextAlign.right, + style: GoogleFonts.poppins( + fontSize: + Responsive.isDesktop( + context) + ? 20 + : 16, + fontWeight: + FontWeight.w600, + ), + ), + ], + ))), + ], + ), + ), + SizedBox(height: 15), + Container( + padding: Responsive.isDesktop(context) + ? EdgeInsets.only( + top: 0, + bottom: 0, + left: 15, + right: 15) + : EdgeInsets.only( + top: 0, bottom: 0, left: 5, right: 5), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: topUpParentMappedFamilyFloatersSi + .where((item) => + item['is_value_exist'] == true) + .map((item) { + Map data = item['data']; + String formattedDate = + formatDate(data['dob']); + return Row( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Icon(Icons.arrow_right, + color: Color( + 0xFFE26728)), // Arrow icon + SizedBox( + width: Responsive.isDesktop( + context) + ? 10 + : 5), // Space between icon and text + Expanded( + child: Text( + '${data['name']} ~ ${data['relationship']} ~ DOB : $formattedDate', + style: GoogleFonts.poppins( + fontSize: Responsive.isDesktop( + context) + ? 18 + : 16, + color: Color(0xFF232526), + ), + ), + ), + ], + ); + }).toList(), + ), + ), + ], + ), + )), + SizedBox(height: showHideTopUpCard == 1 ? 16 : 0), + if (showHideAddOnsCard == 1) + Card( + elevation: 0, + color: Colors.white, + child: Padding( + padding: Responsive.isDesktop(context) + ? EdgeInsets.all(30) + : EdgeInsets.all(10), + child: Column( + children: [ + Container( + child: Row( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Expanded( + flex: 12, + child: Container( + alignment: Alignment.centerLeft, + child: Column( + mainAxisAlignment: + MainAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Text( + 'Add Ons', + textAlign: TextAlign.left, + style: GoogleFonts.poppins( + fontSize: + Responsive.isDesktop( + context) + ? 18 + : 16, + color: Color(0xFF181818), + fontWeight: + FontWeight.w600, + ), + ), + ], + ))), + ], + ), + ), + SizedBox(height: 15), + Container( + decoration: BoxDecoration( + color: Color( + 0xFFFFF1DD), // Set background color for the container + borderRadius: BorderRadius.circular( + 5), // Set border radius for the container + ), + padding: Responsive.isDesktop(context) + ? EdgeInsets.only( + top: 15, + bottom: 15, + left: 25, + right: 25) + : EdgeInsets.only( + top: 10, + bottom: 10, + left: 10, + right: 10), + child: Row( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Expanded( + flex: Responsive.isDesktop(context) + ? 9 + : 8, + child: Container( + alignment: Alignment.centerLeft, + child: Column( + mainAxisAlignment: + MainAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Text( + addOnsDependentPolicyName ?? + '', + textAlign: TextAlign.left, + style: GoogleFonts.poppins( + fontSize: + Responsive.isDesktop( + context) + ? 18 + : 14, + ), + ), + Row( + children: [ + Text( + 'Group Medical Coverage - Dependent AddOns', + textAlign: + TextAlign.left, + style: + GoogleFonts.poppins( + fontSize: Responsive + .isDesktop( + context) + ? 20 + : 16, + fontWeight: + FontWeight.w600, + ), + ), + if (addOnsDependentECardDownload != + null) + GestureDetector( + onTap: () async { + // Convert the URL string to a Uri object + Uri uri = Uri.parse( + addOnsDependentECardDownload); + + // Check if the URL is valid + if (await canLaunchUrl( + uri)) { + // Open the URL in the default browser + await launchUrl( + uri); + } else { + // Handle the case where the URL cannot be launched + print( + 'Could not launch $addOnsDependentECardDownload'); + } + }, + child: MouseRegion( + cursor: + SystemMouseCursors + .click, + child: Icon( + Icons + .file_download, + color: Color( + 0xFFE26728), + size: 25, + ), + ), + ), + ], + ), + ], + ))), + Expanded( + flex: Responsive.isDesktop(context) + ? 3 + : 4, + child: Container( + alignment: Alignment.centerRight, + child: Column( + mainAxisAlignment: + MainAxisAlignment.end, + crossAxisAlignment: + CrossAxisAlignment.end, + children: [ + Text( + addOnsFloaterTextHeading ?? + '', + textAlign: TextAlign.right, + style: GoogleFonts.poppins( + fontSize: + Responsive.isDesktop( + context) + ? 18 + : 14, + ), + ), + Text( + '₹ ${addOnsDependentSumInsured != null ? addOnsDependentSumInsured : 'NA'}', + textAlign: TextAlign.right, + style: GoogleFonts.poppins( + fontSize: + Responsive.isDesktop( + context) + ? 20 + : 16, + fontWeight: + FontWeight.w600, + ), + ), + ], + ))), + ], + ), + ), + SizedBox(height: 15), + Container( + padding: Responsive.isDesktop(context) + ? EdgeInsets.only( + top: 0, + bottom: 0, + left: 15, + right: 15) + : EdgeInsets.only( + top: 0, bottom: 0, left: 5, right: 5), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: + addOnsDependentMappedFamilyFloatersArray + .where((item) => + item['is_value_exist'] == true) + .map((item) { + Map data = item['data']; + return Row( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Icon(Icons.arrow_right, + color: Color( + 0xFFE26728)), // Arrow icon + SizedBox( + width: Responsive.isDesktop( + context) + ? 10 + : 5), // Space between icon and text + Expanded( + child: Text( + '${data['name']} - ${data['relationship']} - ${data['dob']}', + style: GoogleFonts.poppins( + fontSize: Responsive.isDesktop( + context) + ? 18 + : 16, + color: Color(0xFF232526), + ), + ), + ), + ], + ); + }).toList(), + ), + ), + ], + ), + )), + SizedBox(height: showHideAddOnsCard == 1 ? 16 : 0), + Card( + elevation: 0, + color: Colors.white, + child: Padding( + padding: Responsive.isDesktop(context) + ? EdgeInsets.all(30) + : EdgeInsets.all(10), + child: Column( + children: [ + Container( + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + flex: 12, + child: Container( + alignment: Alignment.centerLeft, + child: Column( + mainAxisAlignment: + MainAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Text( + 'Premium Summary', + textAlign: TextAlign.left, + style: GoogleFonts.poppins( + fontSize: + Responsive.isDesktop( + context) + ? 18 + : 16, + color: Color(0xFF181818), + fontWeight: FontWeight.w600, + ), + ), + ], + ))), + ], + ), + ), + SizedBox(height: 15), + Container( + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + flex: 12, + child: Container( + alignment: Alignment + .centerLeft, // Adjust padding as needed + child: Table( + columnWidths: { + 0: FlexColumnWidth( + 2), // Adjust column width as needed + 1: FlexColumnWidth(2), + 2: FlexColumnWidth( + 2), // Adjust column width as needed + 3: FlexColumnWidth(2), + }, + children: [ + TableRow( + children: [ + TableCell( + child: Padding( + padding: + EdgeInsets.all(8.0), + child: Text( + 'Policy ', + textAlign: + TextAlign.start, + style: GoogleFonts.poppins( + fontSize: Responsive + .isDesktop( + context) + ? 16 + : 14, + fontWeight: + FontWeight + .bold), + ), + ), + ), + TableCell( + child: Padding( + padding: + EdgeInsets.all(8.0), + child: Text( + 'Additional Premium', + textAlign: + TextAlign.start, + style: GoogleFonts.poppins( + fontSize: Responsive + .isDesktop( + context) + ? 16 + : 14, + fontWeight: + FontWeight + .bold), + ), + ), + ), + TableCell( + child: Padding( + padding: + EdgeInsets.all(8.0), + child: Text( + 'GST', + textAlign: + TextAlign.start, + style: GoogleFonts.poppins( + fontSize: Responsive + .isDesktop( + context) + ? 16 + : 14, + fontWeight: + FontWeight + .bold), + ), + ), + ), + TableCell( + child: Padding( + padding: + EdgeInsets.all(8.0), + child: Text( + 'Total', + textAlign: + TextAlign.start, + style: GoogleFonts.poppins( + fontSize: Responsive + .isDesktop( + context) + ? 16 + : 14, + fontWeight: + FontWeight + .bold), + ), + ), + ), + ], + ), + if (activeSiData == 1) + TableRow( + children: [ + TableCell( + child: Padding( + padding: + EdgeInsets.all(8.0), + child: Text( + Responsive.isDesktop( + context) + ? topUpTypeName + : 'GMC - Top Up', + textAlign: + TextAlign.start, + style: GoogleFonts.poppins( + fontSize: Responsive + .isDesktop( + context) + ? 14 + : 12), + ), + ), + ), + TableCell( + child: Padding( + padding: + EdgeInsets.all(8.0), + child: Text( + '₹$topUpSiPremiumValue/Year', + textAlign: Responsive + .isDesktop( + context) + ? TextAlign.start + : TextAlign.start, + style: GoogleFonts.poppins( + fontSize: Responsive + .isDesktop( + context) + ? 14 + : 12), + ), + ), + ), + TableCell( + child: Padding( + padding: + EdgeInsets.all(8.0), + child: Text( + '₹$topUpSiPremiumGst/-', + textAlign: Responsive + .isDesktop( + context) + ? TextAlign.start + : TextAlign.start, + style: GoogleFonts.poppins( + fontSize: Responsive + .isDesktop( + context) + ? 14 + : 12), + ), + ), + ), + TableCell( + child: Padding( + padding: + EdgeInsets.all(8.0), + child: Text( + '₹$topUpSiTotalAmt/Year', + textAlign: Responsive + .isDesktop( + context) + ? TextAlign.start + : TextAlign.start, + style: GoogleFonts.poppins( + fontSize: Responsive + .isDesktop( + context) + ? 14 + : 12), + ), + ), + ), + ], + ), + if (activeSiParentData == 1) + TableRow( + children: [ + TableCell( + child: Padding( + padding: + EdgeInsets.all(8.0), + child: Text( + Responsive.isDesktop( + context) + ? topUpParentTypeName + : 'GMC - Parents Top Up', + textAlign: + TextAlign.start, + style: GoogleFonts.poppins( + fontSize: Responsive + .isDesktop( + context) + ? 14 + : 12), + ), + ), + ), + TableCell( + child: Padding( + padding: + EdgeInsets.all(8.0), + child: Text( + '₹$topUpParentSiPremiumValue/Year', + textAlign: Responsive + .isDesktop( + context) + ? TextAlign.start + : TextAlign.start, + style: GoogleFonts.poppins( + fontSize: Responsive + .isDesktop( + context) + ? 14 + : 12), + ), + ), + ), + TableCell( + child: Padding( + padding: + EdgeInsets.all(8.0), + child: Text( + '₹$topUpParentSiPremiumGst/-', + textAlign: Responsive + .isDesktop( + context) + ? TextAlign.start + : TextAlign.start, + style: GoogleFonts.poppins( + fontSize: Responsive + .isDesktop( + context) + ? 14 + : 12), + ), + ), + ), + TableCell( + child: Padding( + padding: + EdgeInsets.all(8.0), + child: Text( + '₹$topUpParentSiTotalAmt/Year', + textAlign: Responsive + .isDesktop( + context) + ? TextAlign.start + : TextAlign.start, + style: GoogleFonts.poppins( + fontSize: Responsive + .isDesktop( + context) + ? 14 + : 12), + ), + ), + ), + ], + ), + if (activeDependentData == 1) + TableRow( + children: [ + TableCell( + child: Padding( + padding: + EdgeInsets.all(8.0), + child: Text( + Responsive.isDesktop( + context) + ? 'Group Medical Coverage - Add Dependent' + : 'GMC - Dependent ', + textAlign: + TextAlign.start, + style: GoogleFonts.poppins( + fontSize: Responsive + .isDesktop( + context) + ? 14 + : 12), + ), + ), + ), + TableCell( + child: Padding( + padding: + EdgeInsets.all(8.0), + child: Text( + '₹$addOnDependentPremiumValue/Year', + textAlign: Responsive + .isDesktop( + context) + ? TextAlign.start + : TextAlign.start, + style: GoogleFonts.poppins( + fontSize: Responsive + .isDesktop( + context) + ? 14 + : 12), + ), + ), + ), + TableCell( + child: Padding( + padding: + EdgeInsets.all(8.0), + child: Text( + '₹$addOnsDependentPremiumGst/-', + textAlign: Responsive + .isDesktop( + context) + ? TextAlign.start + : TextAlign.start, + style: GoogleFonts.poppins( + fontSize: Responsive + .isDesktop( + context) + ? 14 + : 12), + ), + ), + ), + TableCell( + child: Padding( + padding: + EdgeInsets.all(8.0), + child: Text( + '₹$addOnsDependentTotalAmt/Year', + textAlign: Responsive + .isDesktop( + context) + ? TextAlign.start + : TextAlign.start, + style: GoogleFonts.poppins( + fontSize: Responsive + .isDesktop( + context) + ? 14 + : 12), + ), + ), + ), + ], + ), + ], + ), + )) + ], + ), + ), + SizedBox(height: 10), + Container( + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + flex: 6, + child: Container( + alignment: Alignment.centerLeft, + child: Column( + mainAxisAlignment: + MainAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Text( + 'Total Payable', + textAlign: TextAlign.left, + style: GoogleFonts.poppins( + fontSize: + Responsive.isDesktop( + context) + ? 20 + : 16, + color: Color(0xFF181818), + fontWeight: FontWeight.w600, + ), + ), + ], + ))), + Expanded( + flex: 6, + child: Container( + alignment: Alignment.centerRight, + child: Column( + mainAxisAlignment: + MainAxisAlignment.end, + crossAxisAlignment: + CrossAxisAlignment.end, + children: [ + Text( + '₹$totalPayableAmt/Year', + textAlign: TextAlign.right, + style: GoogleFonts.poppins( + fontSize: + Responsive.isDesktop( + context) + ? 18 + : 16, + color: Color(0xFFE26728), + fontWeight: FontWeight.w500, + ), + ), + ], + ))) + ], + ), + ), + SizedBox(height: 15), + Container( + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + flex: 1, + child: Container( + alignment: Alignment.centerLeft, + child: Column( + mainAxisAlignment: + MainAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Checkbox( + value: isChecked, + onChanged: (bool? value) { + setState(() { + isChecked = value!; + }); + }, + activeColor: + Color(0xFFE26728), + ), + ], + ))), + Expanded( + flex: 11, + child: Container( + alignment: Alignment.centerRight, + child: Column( + mainAxisAlignment: + MainAxisAlignment.end, + crossAxisAlignment: + CrossAxisAlignment.end, + children: [ + Text( + 'I declare that the information I have provided is true and accurate to the best of my knowledge', + textAlign: + Responsive.isDesktop( + context) + ? TextAlign.left + : TextAlign.start, + style: GoogleFonts.poppins( + fontSize: + Responsive.isDesktop( + context) + ? 18 + : 15, + color: Color(0xFF292929), + ), + ), + ], + ))), + ], + ), + ), + SizedBox( + height: + Responsive.isDesktop(context) ? 15 : 0), + Container( + child: Row( + children: [ + Expanded( + flex: 6, + child: Container( + width: 150, + height: Responsive.isDesktop(context) + ? 150 + : 100, + alignment: Alignment.centerLeft, + child: ElevatedButton( + onPressed: () async { + // Remove siData, siParentData, and dependentData from local storage + final SharedPreferences prefs = + await SharedPreferences + .getInstance(); + prefs.remove('siData'); + prefs.remove('siParentData'); + prefs.remove('dependentData'); + Navigator.pushNamed( + context, 'addOnsDetails'); + }, + child: Text( + 'Back', + style: GoogleFonts.poppins( + color: Color(0xFFE26728)), + ), + style: ElevatedButton.styleFrom( + backgroundColor: Colors.white, + shape: RoundedRectangleBorder( + borderRadius: + BorderRadius.circular(5), + side: BorderSide( + color: Color(0xFFE26728)), + ), + ), + ), + )), + Expanded( + flex: 6, + child: Container( + width: 150, + height: 150, + alignment: Alignment.centerRight, + child: ElevatedButton( + onPressed: + isChecked ? sendAddOnAPI : null, + child: Text( + 'Submit', + style: GoogleFonts.poppins( + color: Colors.white), + ), + style: ElevatedButton.styleFrom( + backgroundColor: + Color(0xFFE26728), + shape: RoundedRectangleBorder( + borderRadius: + BorderRadius.circular(5), + ), + ), + ), + )), + ], + ), + ), + ], + ), + )), + SizedBox(height: 30) + ], + ), + ), ), - ), - ), - ); + if (isLoading) + Container( + color: Color(0x98FFFCE5), // Semi-transparent background + child: Center( + child: // Your GIF loader widget + Image.asset( + height: 60, + width: 60, + 'assets/nhance-loader.gif'), // Adjust path to your GIF loader + ), + ), + Align( + alignment: Alignment.bottomCenter, + child: Container( + width: double.infinity, // Make the footer full width + child: CustomFooter(), + ), + ), + ])); } } @@ -2341,6 +2501,7 @@ class _empReviewDetailsState extends State { Widget card = getTrueObjects.length > 0 ? Card( elevation: 0, + color: Colors.white, child: Padding( padding: Responsive.isDesktop(context) ? EdgeInsets.all(30) diff --git a/lib/excel_verification.dart b/lib/excel_verification.dart index 535b37e..d5a1c81 100644 --- a/lib/excel_verification.dart +++ b/lib/excel_verification.dart @@ -1,5 +1,6 @@ import 'dart:typed_data'; import 'package:flutter/material.dart'; +import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:jwt_decode/jwt_decode.dart'; import 'package:nhancepolicy/customAppBar/customAppBar.dart'; import 'dart:convert'; @@ -17,6 +18,8 @@ import 'package:csv/csv.dart'; import 'package:spreadsheet_decoder/spreadsheet_decoder.dart'; +import 'customAppBar/customFooter.dart'; + class excelVerify extends StatefulWidget { const excelVerify({Key? key}) : super(key: key); @@ -43,6 +46,7 @@ class _excelVerifyState extends State { dynamic argumentsData; List> originalData = []; // Original data source List> filteredData = []; // Filtered data source + List> tableData = []; // Filtered data source dynamic policy_name; dynamic clientPolicyId; @@ -52,6 +56,12 @@ class _excelVerifyState extends State { dynamic invalidRelationships = 0; dynamic dobAgeCheckCount = 0; dynamic empRefId; + List excelHeader = []; + List>> excelData = []; + late int excelValidationStaus = 1; + bool isSuccess = false; + String successContent = ''; + bool isLoading = false; @override void initState() { @@ -135,8 +145,9 @@ class _excelVerifyState extends State { html.window.localStorage['fileBytes'] = jsonString; print('File Name: $fileName'); print('File Bytes: $fileBytes'); + sendExcelFIleTOAPI(fileBytes, fileName); // Call the function to process Excel data here - _processExcelData(fileBytes, fileName); + // _processExcelData(fileBytes, fileName); } } }); @@ -387,7 +398,12 @@ class _excelVerifyState extends State { } } - Future sendExcelFIleTOAPI(Uint8List fileBytes, String fileName) async { + Future sendExcelFIleTOAPI(Uint8List fileBytes, fileName) async { + // Future.delayed(Duration(seconds: 3), () { + // setState(() { + isLoading = true; + // }); + // }); print('submit'); print(fileBytes); if (fileBytes == null) { @@ -434,19 +450,43 @@ class _excelVerifyState extends State { print('else'); // Check the status code of the response if (response.statusCode == 200) { + isLoading = false; Map data = json.decode(responseString); if (data['status'] == 'success') { - html.window.localStorage.remove('fileBytes'); - // ToastHelper.showSuccessToast(context, 'File uploaded successfully'); - ToastHelper.showSuccessToast( - context, 'Data Successfully Imported...'); - print('Data Successfully Imported'); - Navigator.pushNamed(context, 'hrPolicyDetails', - arguments: argumentsData); + ToastHelper.showSuccessToast(context, data['message']); + print('Table'); + + setState(() { + isSuccess = true; + successContent = data['message']; + excelValidationStaus = 0; + // excelHeader = List.from(data['data']['excel_header']); + // print('excelHeader : $excelHeader'); + // excelData = (data['data']['excel_data'] as List) + // .map>>((row) => row + // .map>( + // (cell) => Map.from(cell)) + // .toList()) + // .toList(); + // print('excelHeader : $excelHeader'); + }); } else { - // ToastHelper.showSuccessToast(context, 'File uploaded successfully'); - ToastHelper.showErrorToast(context, 'Failed to Imported...'); - // Navigator.pushNamed(context, 'hrHome'); + ToastHelper.showErrorToast(context, data['message']); + print('Table'); + + setState(() { + isSuccess = false; + excelValidationStaus = 1; + excelHeader = List.from(data['data']['excel_header']); + print('excelHeader : $excelHeader'); + excelData = (data['data']['excel_data'] as List) + .map>>((row) => row + .map>( + (cell) => Map.from(cell)) + .toList()) + .toList(); + print('excelHeader : $excelHeader'); + }); } } else { // ToastHelper.showSuccessToast( @@ -483,26 +523,28 @@ class _excelVerifyState extends State { fileBytes = null; fileName = null; _currentStep = 0; + excelHeader.clear(); + excelData.clear(); - extractedData = []; - originalData = []; - filteredData = []; - validationArray = []; - nonExcelFilteredData = []; - print('filteredData'); - print(filteredData); - print(validationArray); - - missingColumnErrorMsg = 0; - print(missingColumnErrorMsg); - columnMissingCount = 0; - print(columnMissingCount); - columnIndexMismatchCount = 0; - print(columnIndexMismatchCount); - invalidRelationships = 0; - dobAgeCheckCount = 0; - - html.window.localStorage.remove('fileBytes'); + // extractedData = []; + // originalData = []; + // filteredData = []; + // validationArray = []; + // nonExcelFilteredData = []; + // print('filteredData'); + // print(filteredData); + // print(validationArray); + // + // missingColumnErrorMsg = 0; + // print(missingColumnErrorMsg); + // columnMissingCount = 0; + // print(columnMissingCount); + // columnIndexMismatchCount = 0; + // print(columnIndexMismatchCount); + // invalidRelationships = 0; + // dobAgeCheckCount = 0; + // + // html.window.localStorage.remove('fileBytes'); }); } @@ -516,586 +558,657 @@ class _excelVerifyState extends State { } return Scaffold( - appBar: CustomAppBar(), - body: SafeArea( - child: Theme( - data: ThemeData( - canvasColor: Color(0xFFF4F7FE), - colorScheme: Theme.of(context).colorScheme.copyWith( - primary: Color(0xFFE26728), - background: Colors.red, - secondary: Color(0xFFE26728), - ), - ), - child: Container( - padding: const EdgeInsets.all(20), - color: Color(0xFFEFF3F6), - child: Card( - elevation: 0, - child: Column( - children: [ - Expanded( - child: Stepper( - type: StepperType.horizontal, - currentStep: _currentStep, - controlsBuilder: - (BuildContext context, ControlsDetails controls) { - return Container( - alignment: Alignment.bottomCenter, - padding: const EdgeInsets.all(16.0), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - ElevatedButton( - onPressed: () { - html.window.localStorage.remove('fileBytes'); - fileBytes = null; - fileName = null; - _currentStep = 0; - missingColumnErrorMsg = 0; - columnIndexMismatchCount = 0; - columnMissingCount = 0; - invalidRelationships = 0; - dobAgeCheckCount = 0; - nonExcelFilteredData = []; - Navigator.pushNamed( - context, 'hrPolicyDetails', - arguments: argumentsData); + appBar: CustomAppBar(), + body: Stack(children: [ + SafeArea( + child: Theme( + data: ThemeData( + canvasColor: Color(0xFFF4F7FE), + colorScheme: Theme.of(context).colorScheme.copyWith( + primary: Color(0xFFE26728), + background: Colors.red, + secondary: Color(0xFFE26728), + ), + ), + child: Container( + padding: const EdgeInsets.all(20), + color: Color(0xFFEFF3F6), + child: Card( + elevation: 1, + color: Colors.white, + child: Column( + children: [ + Expanded( + child: Stepper( + type: StepperType.horizontal, + currentStep: _currentStep, + controlsBuilder: + (BuildContext context, ControlsDetails controls) { + return Container( + alignment: Alignment.bottomCenter, + padding: const EdgeInsets.all(16.0), + child: Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + ElevatedButton( + onPressed: () { + html.window.localStorage + .remove('fileBytes'); + fileBytes = null; + fileName = null; + _currentStep = 0; + excelHeader.clear(); + excelData.clear(); + // missingColumnErrorMsg = 0; + // columnIndexMismatchCount = 0; + // columnMissingCount = 0; + // invalidRelationships = 0; + // dobAgeCheckCount = 0; + // nonExcelFilteredData = []; + Navigator.pushNamed( + context, 'hrPolicyDetails', + arguments: argumentsData); + }, + child: Text( + 'Close', + style: + TextStyle(color: Color(0xFFE26728)), + ), + style: ElevatedButton.styleFrom( + backgroundColor: Colors.white, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(5), + side: BorderSide( + color: Color(0xFFE26728)), + ), + ), + ), + // SizedBox(width: 10), + // if (fileName != null) + // ElevatedButton( + // onPressed: () { + // // Reset localStorage and fileBytes + // setState(() { + // html.window.localStorage + // .remove('fileBytes'); + // fileBytes = null; + // fileName = null; + // _currentStep = 0; + // }); + // }, + // child: Text( + // 'Reselect File', + // style: TextStyle(color: Color(0xFFE26728)), + // ), + // style: ElevatedButton.styleFrom( + // backgroundColor: Colors.white, + // shape: RoundedRectangleBorder( + // borderRadius: BorderRadius.circular(5), + // side: + // BorderSide(color: Color(0xFFE26728)), + // ), + // ), + // ), + Spacer(), + SizedBox( + width: + 10), // This pushes the buttons to the right + if (_currentStep != 0) + ElevatedButton( + onPressed: () { + controls.onStepCancel!(); + }, + child: Text( + 'Previous', + style: + TextStyle(color: Color(0xFFE26728)), + ), + style: ElevatedButton.styleFrom( + backgroundColor: Colors.white, + shape: RoundedRectangleBorder( + borderRadius: + BorderRadius.circular(5), + side: BorderSide( + color: Color(0xFFE26728)), + ), + ), + ), + SizedBox(width: 10), + ElevatedButton( + child: const Text( + 'NEXT', + style: TextStyle(color: Colors.white), + ), + style: ElevatedButton.styleFrom( + backgroundColor: Color(0xFFE26728), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(5), + ), + ), + // Disable button if excelValidationStatus is 1 + // Use ternary operator to conditionally set onPressed to null + onPressed: (_currentStep == 0 && + fileName == null) || + (_currentStep == 1 && + excelValidationStaus == 1) + ? null + : () { + if (_currentStep == 0) { + // For Step 0: Enable continue if fileName is not null + if (fileName != null) { + controls.onStepContinue!(); + } + } else if (_currentStep == 1) { + // For Step 1: Check excelValidationStatus + if (excelValidationStaus == 0) { + // Navigate to hrPolicyDetails page + Navigator.pushNamed( + context, 'hrPolicyDetails', + arguments: argumentsData); + } + // If excelValidationStatus is 1, button will be disabled (do nothing) + } + }, + ), + SizedBox(width: 10), + // if (_currentStep == 2) + // ElevatedButton( + // onPressed: () { + // _retrieveAndUploadFile(); + // }, + // child: Text( + // 'Submit', + // style: TextStyle(color: Colors.white), + // ), + // style: ElevatedButton.styleFrom( + // backgroundColor: Color(0xFFE26728), + // shape: RoundedRectangleBorder( + // borderRadius: BorderRadius.circular(5), + // ), + // ), + // ), + ], + ), + ); + }, + onStepContinue: _currentStep == 2 + ? null + : () { + if (_currentStep == 0) { + // For the first step, allow continue if fileName is not null + if (fileName != null) { + setState(() { + _currentStep += 1; + }); + } + } else if (_currentStep == 1) { + // For the second step, allow continue if both errors are 0 + if (missingColumnErrorMsg == 0 && + columnIndexMismatchCount == 0 && + invalidRelationships == 0 && + dobAgeCheckCount == 0) { + setState(() { + _currentStep += 1; + }); + } + } + // setState(() { + // // Increment the current step when the user clicks continue + // if (_currentStep < 2) { + // _currentStep += 1; + // } + // }); }, - child: Text( - 'Close', - style: TextStyle(color: Color(0xFFE26728)), - ), - style: ElevatedButton.styleFrom( - backgroundColor: Colors.white, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(5), - side: BorderSide(color: Color(0xFFE26728)), - ), - ), - ), - // SizedBox(width: 10), - // if (fileName != null) - // ElevatedButton( - // onPressed: () { - // // Reset localStorage and fileBytes - // setState(() { - // html.window.localStorage - // .remove('fileBytes'); - // fileBytes = null; - // fileName = null; - // _currentStep = 0; - // }); - // }, - // child: Text( - // 'Reselect File', - // style: TextStyle(color: Color(0xFFE26728)), - // ), - // style: ElevatedButton.styleFrom( - // backgroundColor: Colors.white, - // shape: RoundedRectangleBorder( - // borderRadius: BorderRadius.circular(5), - // side: - // BorderSide(color: Color(0xFFE26728)), - // ), - // ), - // ), - Spacer(), - SizedBox( - width: - 10), // This pushes the buttons to the right - if (_currentStep != 0) - ElevatedButton( - onPressed: () { - controls.onStepCancel!(); - }, - child: Text( - 'Previous', - style: TextStyle(color: Color(0xFFE26728)), - ), - style: ElevatedButton.styleFrom( - backgroundColor: Colors.white, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(5), - side: - BorderSide(color: Color(0xFFE26728)), - ), - ), - ), - SizedBox(width: 10), - if (_currentStep != 2) - ElevatedButton( - onPressed: _currentStep == 0 - ? (fileName != null - ? controls.onStepContinue! - : null) - : (_currentStep == 1 - ? (missingColumnErrorMsg == 0 && - columnIndexMismatchCount == - 0 && - invalidRelationships == 0 && - dobAgeCheckCount == 0 - ? controls.onStepContinue! - : null) - : null), - child: const Text( - 'NEXT', - style: TextStyle(color: Colors.white), - ), - style: ElevatedButton.styleFrom( - backgroundColor: Color(0xFFE26728), - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(5), - ), - ), - ), - SizedBox(width: 10), - if (_currentStep == 2) - ElevatedButton( - onPressed: () { - _retrieveAndUploadFile(); - }, - child: Text( - 'Submit', - style: TextStyle(color: Colors.white), - ), - style: ElevatedButton.styleFrom( - backgroundColor: Color(0xFFE26728), - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(5), - ), - ), - ), - ], - ), - ); - }, - onStepContinue: _currentStep == 2 - ? null - : () { - if (_currentStep == 0) { - // For the first step, allow continue if fileName is not null - if (fileName != null) { - setState(() { - _currentStep += 1; - }); - } - } else if (_currentStep == 1) { - // For the second step, allow continue if both errors are 0 - if (missingColumnErrorMsg == 0 && - columnIndexMismatchCount == 0 && - invalidRelationships == 0 && - dobAgeCheckCount == 0) { - setState(() { - _currentStep += 1; - }); - } + onStepCancel: () { + setState(() { + // Decrement the current step when the user clicks cancel + if (_currentStep > 0) { + _currentStep -= 1; } - // setState(() { - // // Increment the current step when the user clicks continue - // if (_currentStep < 2) { - // _currentStep += 1; - // } - // }); - }, - onStepCancel: () { - setState(() { - // Decrement the current step when the user clicks cancel - if (_currentStep > 0) { - _currentStep -= 1; - } - }); - }, - steps: [ - Step( - title: Container( - child: Text( - 'Import Excel', - style: TextStyle( - color: Color(0xFFE26728), + }); + }, + steps: [ + Step( + title: Container( + child: Text( + 'Import Excel', + style: TextStyle( + color: Color(0xFFE26728), + ), + ), ), - ), - ), - content: Container( - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - flex: 12, - child: Column( - children: [ - Row( - mainAxisAlignment: - MainAxisAlignment.center, + content: Container( + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Expanded( + flex: 12, + child: Column( children: [ - Expanded( - child: Text( - '$policy_name - ($policyType)', - textAlign: TextAlign.center, - style: TextStyle( - fontSize: 20, - fontWeight: FontWeight - .w600, // Adjust the font size as needed - color: Color( - 0xFF181818), // Adjust the text color as needed + Row( + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + Expanded( + child: Text( + '$policy_name - ($policyType)', + textAlign: TextAlign.center, + style: TextStyle( + fontSize: 20, + fontWeight: FontWeight + .w600, // Adjust the font size as needed + color: Color( + 0xFF181818), // Adjust the text color as needed + ), + ), + ) + ], + ), + SizedBox(height: 20), + Row( + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + Expanded( + child: Container( + margin: EdgeInsets.symmetric( + horizontal: 150), + alignment: Alignment.center, + color: Colors.grey[200], + height: + 250, // Adjust height as needed + child: DragTarget( + onAccept: (html.File + droppedFile) { + setState(() { + fileName = + droppedFile.name; + }); + _dragAndDropFile( + droppedFile); + }, + builder: + (BuildContext context, + List + candidateData, + List + rejectedData) { + return Container( + alignment: + Alignment.center, + child: Column( + mainAxisAlignment: + MainAxisAlignment + .center, + children: [ + // if (fileName == null) + // ElevatedButton( + // onPressed: () => {}, + // child: Icon( + // Icons.download, + // color: Colors + // .grey), // You can replace the Icon with your custom button child + // style: + // ElevatedButton + // .styleFrom( + // shape: + // CircleBorder(), // Makes the button round + // padding: + // EdgeInsets.all( + // 18), // Change the button color as needed + // ), + // ), + // SizedBox(height: 20), + // if (fileName == null) + // Text( + // 'Drag and drop file to import', + // style: TextStyle( + // fontSize: 16, + // fontWeight: + // FontWeight + // .w600), + // ), // Add spacing between texts + // SizedBox(height: 20), + fileName != null + ? Column( + mainAxisAlignment: + MainAxisAlignment + .center, + children: [ + Icon( + Icons + .upload_file, // Choose the appropriate icon + size: + 35, + color: Color( + 0xFFE26728), // Adjust the size as needed + ), + SizedBox( + height: + 15), // Add some space between the icon and text + Text( + '$fileName', + style: TextStyle( + fontSize: + 16), + ), + SizedBox( + height: + 25), // Add some space between the icon and text + MouseRegion( + cursor: + SystemMouseCursors.click, // Set cursor to pointer on hover + child: + GestureDetector( + onTap: + () { + resetErrorCount(); + }, + child: + Row( + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + Icon( + Icons.delete_forever, // Choose the remove icon + size: 20, // Adjust the size as needed + color: Colors.red, // Set the color of the remove icon + ), + SizedBox(width: 1), // Add some space between the icon and text + Text( + 'Remove', + style: TextStyle(fontSize: 13, color: Color(0xFF727272)), + ), + ], + ), + ), + ) + ], + ) + : ElevatedButton( + onPressed: () => + _uploadFile( + 'Policy Name'), + child: Text( + 'Select File', + style: TextStyle( + color: + Colors.white), + ), + style: ElevatedButton + .styleFrom( + backgroundColor: + Color( + 0xFFE26728), + ), + ), + SizedBox( + height: 20), + if (fileName == + null) + Text( + 'Supported Files : XLSX') + // Add more Text widgets for additional lines of text + ], + ), + ); + }, + ), + ), ), - ), + ], + ), + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + Expanded( + child: Column( + mainAxisAlignment: + MainAxisAlignment + .start, + children: [ + Text( + 'Ensure that the import file is in the correct format by comparing it with our template file.', + textAlign: + TextAlign.center, + style: TextStyle( + fontSize: 16, + fontWeight: + FontWeight.w400, + )), + MouseRegion( + cursor: SystemMouseCursors + .click, + child: GestureDetector( + onTap: () { + downloadSampleFile(); + }, + child: Text( + 'Template File', + style: TextStyle( + fontSize: 15, + color: Color( + 0xFFE26728), // Add underline decoration + ), + ), + ), + ) + ])) + ], ) ], ), - SizedBox(height: 20), - Row( - mainAxisAlignment: - MainAxisAlignment.center, - children: [ - Expanded( - child: Container( - margin: EdgeInsets.symmetric( - horizontal: 150), - alignment: Alignment.center, - color: Colors.grey[200], - height: - 250, // Adjust height as needed - child: DragTarget( - onAccept: - (html.File droppedFile) { - setState(() { - fileName = droppedFile.name; - }); - _dragAndDropFile(droppedFile); - }, - builder: (BuildContext context, - List candidateData, - List - rejectedData) { - return Container( - alignment: Alignment.center, - child: Column( - mainAxisAlignment: - MainAxisAlignment - .center, - children: [ - // if (fileName == null) - // ElevatedButton( - // onPressed: () => {}, - // child: Icon( - // Icons.download, - // color: Colors - // .grey), // You can replace the Icon with your custom button child - // style: - // ElevatedButton - // .styleFrom( - // shape: - // CircleBorder(), // Makes the button round - // padding: - // EdgeInsets.all( - // 18), // Change the button color as needed - // ), - // ), - // SizedBox(height: 20), - // if (fileName == null) - // Text( - // 'Drag and drop file to import', - // style: TextStyle( - // fontSize: 16, - // fontWeight: - // FontWeight - // .w600), - // ), // Add spacing between texts - // SizedBox(height: 20), - fileName != null - ? Column( - mainAxisAlignment: - MainAxisAlignment - .center, - children: [ - Icon( - Icons - .upload_file, // Choose the appropriate icon - size: 35, - color: Color( - 0xFFE26728), // Adjust the size as needed - ), - SizedBox( - height: - 15), // Add some space between the icon and text - Text( - '$fileName', - style: TextStyle( - fontSize: - 16), - ), - SizedBox( - height: - 25), // Add some space between the icon and text - MouseRegion( - cursor: SystemMouseCursors - .click, // Set cursor to pointer on hover - child: - GestureDetector( - onTap: - () { - resetErrorCount(); - }, - child: - Row( - mainAxisAlignment: - MainAxisAlignment.center, - children: [ - Icon( - Icons.delete_forever, // Choose the remove icon - size: - 20, // Adjust the size as needed - color: - Colors.red, // Set the color of the remove icon - ), - SizedBox( - width: 1), // Add some space between the icon and text - Text( - 'Remove', - style: - TextStyle(fontSize: 13, color: Color(0xFF727272)), - ), - ], - ), - ), - ) - ], - ) - : ElevatedButton( - onPressed: () => - _uploadFile( - 'Policy Name'), - child: Text( - 'Select File', - style: TextStyle( - color: Colors - .white), - ), - style: ElevatedButton - .styleFrom( - backgroundColor: - Color( - 0xFFE26728), - ), - ), - SizedBox(height: 20), - if (fileName == null) - Text( - 'Supported Files : XLSX') - // Add more Text widgets for additional lines of text - ], - ), - ); - }, - ), - ), - ), - ], - ), - Row( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - Expanded( - child: Column( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - Text( - 'Ensure that the import file is in the correct format by comparing it with our template file.', - textAlign: TextAlign.center, - style: TextStyle( - fontSize: 16, - fontWeight: - FontWeight.w400, - )), - MouseRegion( - cursor: - SystemMouseCursors.click, - child: GestureDetector( - onTap: () { - downloadSampleFile(); - }, - child: Text( - 'Template File', - style: TextStyle( - fontSize: 15, - color: Color( - 0xFFE26728), // Add underline decoration - ), - ), - ), - ) - ])) - ], - ) - ], - ), - ), - ], - ), - ), - isActive: _currentStep == 0, - ), - Step( - title: Text( - 'Excel Validation', - style: TextStyle(color: Color(0xFFE26728)), - ), - content: Padding( - padding: EdgeInsets.only( - top: 30, - bottom: 30, - left: 300, - right: - 300), // Adjust the horizontal padding as needed - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - _buildRowWithIcon( - missingColumnErrorMsg == 0 - ? Icons.check_circle - : Icons.error, - 'No of column missing : $missingColumnErrorMsg Column', - iconColor: missingColumnErrorMsg == 0 - ? Colors.green - : Colors - .red, // Set color based on condition - ), - if (missingColumnErrorMsg == 0) - _buildRowWithIcon( - columnIndexMismatchCount == 0 - ? Icons.check_circle - : Icons.error, - 'Mismatch in Column Order : $columnIndexMismatchCount - Column', - iconColor: columnIndexMismatchCount == 0 - ? Colors.green - : Colors.red, - ), - _buildRowWithIcon( - invalidRelationships == 0 - ? Icons.check_circle - : Icons.error, - 'Invalid Relationships : $invalidRelationships - Rows', - iconColor: invalidRelationships == 0 - ? Colors.green - : Colors.red, - ), - _buildRowWithIcon( - dobAgeCheckCount == 0 - ? Icons.check_circle - : Icons.error, - 'Age Config - $dobAgeCheckCount - Rows', - iconColor: dobAgeCheckCount == 0 - ? Colors.green - : Colors.red, - ), - ], - ), - ), - isActive: _currentStep == 1, - ), - Step( - title: Text( - 'Preview', - style: TextStyle(color: Color(0xFFE26728)), - ), - content: Column( - children: [ - Row( - children: [ - Expanded( - flex: 10, - child: Container( - alignment: Alignment.centerLeft, - child: Container( - width: - 350, // Set your desired width here - height: - 40, // Set your desired height here - decoration: BoxDecoration( - boxShadow: [ - BoxShadow( - color: Color.fromRGBO( - 255, - 255, - 255, - 0.5), // Shadow color with opacity - offset: Offset(5, - 5), // Shadow position (horizontal, vertical) - blurRadius: 10, // Blur radius - spreadRadius: - 0, // Spread radius - ), - ], - borderRadius: - BorderRadius.circular(5), - ), - child: TextField( - textAlignVertical: TextAlignVertical - .center, // Center the text vertically - decoration: InputDecoration( - hintText: 'Search', - suffixIcon: Icon(Icons.search), - contentPadding: EdgeInsets.all( - 10), // Adjust the horizontal padding - border: OutlineInputBorder( - borderSide: BorderSide( - color: Color( - 0xFFf5f5f7)), // Set border color to gray - ), - ), - onChanged: - search, // Call the search method on text change - ), - )), - ), - ], - ), - SizedBox(height: 20), - Row( - children: [ - Expanded( - child: SingleChildScrollView( - child: _buildDataTable(), ), - ) - ], + ], + ), ), - ], - ), - isActive: _currentStep == 2, + isActive: _currentStep == 0, + ), + Step( + title: Text( + 'Excel Validation', + style: TextStyle(color: Color(0xFFE26728)), + ), + content: isSuccess + ? Center( + child: Text( + successContent, + style: TextStyle( + fontSize: 20, color: Colors.green), + ), + ) + : excelHeader.isNotEmpty && + excelData.isNotEmpty + ? SingleChildScrollView( + scrollDirection: Axis.vertical, + child: SingleChildScrollView( + scrollDirection: Axis.horizontal, + child: DataTable( + columns: excelHeader + .map((header) => DataColumn( + label: Text(header))) + .toList(), + rows: excelData + .map((row) => DataRow( + cells: row + .map( + (cell) => + DataCell( + cell.containsKey( + 'error') + ? Row( + children: [ + Text(cell['value'] ?? ''), + SizedBox(width: 5), + IconButton( + icon: Icon( + Icons.error_outline, + color: Colors.red, + size: 16, + ), + onPressed: () { + showDialog( + context: context, + builder: (context) { + return AlertDialog( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(30.0), + ), + elevation: 0, + backgroundColor: Colors.white, + title: Text('Error Details'), + content: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: (cell['error'] as List).map((e) => Text(e)).toList(), + ), + actions: [ + TextButton( + onPressed: () { + Navigator.of(context).pop(); + }, + child: Text('OK'), + ), + ], + ); + }, + ); + }, + ), + ], + ) + : Text(cell['value'] ?? + ''), + )) + .toList(), + )) + .toList(), + ), + ), + ) + : Center( + child: CircularProgressIndicator()), + isActive: _currentStep == 1, + ), + // Step( + // title: Text( + // 'Preview', + // style: TextStyle(color: Color(0xFFE26728)), + // ), + // content: Column( + // children: [ + // Row( + // children: [ + // Expanded( + // flex: 10, + // child: Container( + // alignment: Alignment.centerLeft, + // child: Container( + // width: + // 350, // Set your desired width here + // height: + // 40, // Set your desired height here + // decoration: BoxDecoration( + // boxShadow: [ + // BoxShadow( + // color: Color.fromRGBO( + // 255, + // 255, + // 255, + // 0.5), // Shadow color with opacity + // offset: Offset(5, + // 5), // Shadow position (horizontal, vertical) + // blurRadius: 10, // Blur radius + // spreadRadius: + // 0, // Spread radius + // ), + // ], + // borderRadius: + // BorderRadius.circular(5), + // ), + // child: TextField( + // textAlignVertical: TextAlignVertical + // .center, // Center the text vertically + // decoration: InputDecoration( + // hintText: 'Search', + // suffixIcon: Icon(Icons.search), + // contentPadding: EdgeInsets.all( + // 10), // Adjust the horizontal padding + // border: OutlineInputBorder( + // borderSide: BorderSide( + // color: Color( + // 0xFFf5f5f7)), // Set border color to gray + // ), + // ), + // onChanged: + // search, // Call the search method on text change + // ), + // )), + // ), + // ], + // ), + // SizedBox(height: 20), + // Row( + // children: [ + // Expanded( + // child: SingleChildScrollView( + // child: _buildDataTable(), + // ), + // ) + // ], + // ), + // ], + // ), + // isActive: _currentStep == 2, + // ), + ], ), - ], - ), + ), + // SizedBox(height: 20), + // if (_currentStep == 2) + // Align( + // alignment: Alignment.bottomRight, + // child: ElevatedButton( + // onPressed: () { + // sendExcelFIleTOAPI(); + // }, + // child: Text( + // 'Complete', + // style: TextStyle(color: Colors.white), + // ), + // style: ElevatedButton.styleFrom( + // backgroundColor: Color(0xFFE26728), + // ), + // ), + // ), + // SizedBox(height: 20), + ], ), - // SizedBox(height: 20), - // if (_currentStep == 2) - // Align( - // alignment: Alignment.bottomRight, - // child: ElevatedButton( - // onPressed: () { - // sendExcelFIleTOAPI(); - // }, - // child: Text( - // 'Complete', - // style: TextStyle(color: Colors.white), - // ), - // style: ElevatedButton.styleFrom( - // backgroundColor: Color(0xFFE26728), - // ), - // ), - // ), - // SizedBox(height: 20), - ], + ), ), ), ), - ), - ), - ); + if (isLoading) + Container( + color: Color(0x98FFFCE5), // Semi-transparent background + child: Center( + child: // Your GIF loader widget + Image.asset( + height: 60, + width: 60, + 'assets/nhance-loader.gif'), // Adjust path to your GIF loader + ), + ), + Align( + alignment: Alignment.bottomCenter, + child: Container( + width: double.infinity, // Make the footer full width + child: CustomFooter(), + ), + ), + ])); } Widget _buildDataTable() { diff --git a/lib/hrDashboard.dart b/lib/hrDashboard.dart index b481adc..9a9cf78 100644 --- a/lib/hrDashboard.dart +++ b/lib/hrDashboard.dart @@ -11,6 +11,7 @@ import 'package:nhancepolicy/service/api_service.dart'; import 'package:shared_preferences/shared_preferences.dart'; import 'package:http/http.dart' as http; import 'customAppBar/customAppBar.dart'; +import 'customAppBar/customFooter.dart'; import 'customAppBar/toastHelper.dart'; import 'package:universal_html/html.dart' as html; import 'package:intl/intl.dart'; @@ -24,10 +25,10 @@ class hrDashboard extends StatefulWidget { class _hrDashboardState extends State { late ApiService apiService; - bool isLoading = true; + bool isLoading = false; late String _token; dynamic getPolicyNo; - bool _isLoading = false; + // bool _isLoading = false; dynamic getPolicyNameDetails; dynamic clintID; dynamic policy_name; @@ -41,17 +42,18 @@ class _hrDashboardState extends State { Color(0xFFDBFFDE), Color(0xFFE4DFFF), ]; + ScrollController _scrollController = ScrollController(); @override void initState() { super.initState(); apiService = ApiService(context); // Initialize ApiService here _loadToken(); - Future.delayed(Duration(seconds: 3), () { - setState(() { - isLoading = false; - }); - }); + // Future.delayed(Duration(seconds: 3), () { + // setState(() { + // isLoading = false; + // }); + // }); } @override @@ -134,9 +136,10 @@ class _hrDashboardState extends State { } Future getCashDepositDetails(String clintID) async { - setState(() { - _isLoading = true; - }); + isLoading = true; + // setState(() { + // _isLoading = true; + // }); try { if (clintID == null || empRefId == null) { return; @@ -144,6 +147,7 @@ class _hrDashboardState extends State { final response = await apiService.getCashDepositDetailsToApi(clintID!, empRefId!); if (response['status'] == 'success') { + isLoading = false; setState(() { getCardArrays = List>.from(response['data']); print(getCardArrays); @@ -223,12 +227,13 @@ class _hrDashboardState extends State { SingleChildScrollView( child: Container( padding: - EdgeInsets.only(top: 30, bottom: 30, left: 50, right: 50), + EdgeInsets.only(top: 30, bottom: 200, left: 50, right: 50), color: Color(0xFFEFF3F6), child: Column( children: [ Card( elevation: 0, + color: Colors.white, child: Container( width: double.infinity, height: 75, @@ -298,321 +303,335 @@ class _hrDashboardState extends State { ), ), SizedBox(height: 16), + // if (getCardArrays.length != 0) + // Card( + // elevation: 0, + // color: Colors.white, + // child: Container( + // width: double.infinity, + // padding: Responsive.isDesktop(context) + // ? EdgeInsets.all(20) + // : EdgeInsets.all( + // 10), // Add padding to the container + // child: Column(children: [ + // Row(children: [ + // Text( + // 'Cash Transaction', + // style: GoogleFonts.poppins( + // fontSize: 18, + // fontWeight: FontWeight.w600, + // color: Colors.black, + // ), + // ) + // ]), + // SizedBox(height: 8), + // Row( + // children: [ + // // Create an Expanded widget with flex of 4 for each card + // for (var cardData in getCardArrays) + // Container( + // width: + // 300, // Set a fixed width for the card + // height: cardHeight, + // child: Card( + // elevation: 3, + // color: cardColors[ + // getCardArrays.indexOf(cardData) % + // cardColors.length], + // child: Column( + // crossAxisAlignment: + // CrossAxisAlignment.start, + // children: [ + // ListTile( + // title: SizedBox( + // height: 50, + // child: Text( + // cardData['insurerName'], + // style: GoogleFonts.poppins( + // fontSize: 18, + // fontWeight: FontWeight.w500, + // color: Color(0xFF000000), + // height: 1.5, + // ), + // ), + // ), + // subtitle: Text( + // 'Balance: ₹ ${cardData['balance']}', + // style: GoogleFonts.poppins( + // fontSize: 16, + // fontWeight: FontWeight.w400, + // color: Color(0xFF000000), + // height: 1.5, + // ), + // ), + // ), + // SizedBox(height: 10), + // Padding( + // padding: EdgeInsets.symmetric( + // horizontal: 15), + // child: GestureDetector( + // onTap: () { + // openForm( + // cardData['depositData'], + // cardData['insurerName'], + // cardData['clientId'], + // cardData['insurerId'], + // cardColors[getCardArrays + // .indexOf(cardData) % + // cardColors.length], + // ); + // }, + // child: MouseRegion( + // cursor: + // SystemMouseCursors.click, + // child: Align( + // alignment: + // Alignment.centerRight, + // child: Text( + // 'View Details', + // style: + // GoogleFonts.poppins( + // color: + // Color(0xFF000000), + // fontSize: 14, + // fontWeight: + // FontWeight.w300, + // height: 1.5, + // ), + // ), + // ), + // ), + // ), + // ), + // ], + // ), + // ), + // ), + // ], + // ), + // ])), + // ), + // SizedBox(height: 16), if (getCardArrays.length != 0) Card( elevation: 0, - child: Container( - width: double.infinity, - padding: Responsive.isDesktop(context) - ? EdgeInsets.all(20) - : EdgeInsets.all( - 10), // Add padding to the container - child: Column(children: [ - Row(children: [ - Text( - 'Cash Transaction', - style: GoogleFonts.poppins( - fontSize: 18, - fontWeight: FontWeight.w600, - color: Colors.black, - ), - ) - ]), - SizedBox(height: 8), + color: Colors.white, + child: Padding( + padding: Responsive.isDesktop(context) + ? EdgeInsets.all(20) + : EdgeInsets.all(10), + child: Column( + children: [ Row( children: [ - // Create an Expanded widget with flex of 4 for each card - for (var cardData in getCardArrays) - Container( - width: - 300, // Set a fixed width for the card - height: cardHeight, - child: Card( - elevation: 3, - color: cardColors[ - getCardArrays.indexOf(cardData) % - cardColors.length], - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - ListTile( - title: SizedBox( - height: 50, - child: Text( - cardData['insurerName'], - style: GoogleFonts.poppins( - fontSize: 18, - fontWeight: FontWeight.w500, - color: Color(0xFF000000), - height: 1.5, - ), - ), - ), - subtitle: Text( - 'Balance: ₹ ${cardData['balance']}', + Expanded( + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: List.generate( + numExpanded, + (index) { + var insurerName = getCardArrays[index] + ['insurerName']; + var policyDetails = + getCardArrays[index] + ['policyDetails']; + + // Determine the color for the policyDetails based on the index of the card in getCardArrays + var cardColorIndex = + getCardArrays.indexOf( + getCardArrays[index]) % + cardColors.length; + var cardColor = + cardColors[cardColorIndex]; + + return Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Text( + insurerName, style: GoogleFonts.poppins( - fontSize: 16, - fontWeight: FontWeight.w400, - color: Color(0xFF000000), - height: 1.5, + fontSize: 18, + fontWeight: FontWeight.w600, + color: Colors.black, ), ), - ), - SizedBox(height: 10), - Padding( - padding: EdgeInsets.symmetric( - horizontal: 15), - child: GestureDetector( - onTap: () { - openForm( - cardData['depositData'], - cardData['insurerName'], - cardData['clientId'], - cardData['insurerId'], - cardColors[getCardArrays - .indexOf(cardData) % - cardColors.length], - ); - }, - child: MouseRegion( - cursor: - SystemMouseCursors.click, - child: Align( - alignment: - Alignment.centerRight, - child: Text( - 'View Details', - style: - GoogleFonts.poppins( - color: - Color(0xFF000000), - fontSize: 14, - fontWeight: - FontWeight.w300, - height: 1.5, - ), - ), + SizedBox(height: 8), + Row( + children: [ + IconButton( + icon: + Icon(Icons.arrow_back), + onPressed: () { + _scrollController + .animateTo( + _scrollController + .offset - + 300, + duration: Duration( + milliseconds: 500), + curve: Curves.easeInOut, + ); + }, ), - ), - ), - ), - ], - ), - ), - ), - ], - ), - ])), - ), - SizedBox(height: 16), - if (getCardArrays.length != 0) - Card( - elevation: 0, - child: Padding( - padding: Responsive.isDesktop(context) - ? EdgeInsets.all(20) - : EdgeInsets.all(10), - child: Column( - children: [ - Row( - children: [ - Expanded( - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: List.generate( - numExpanded, - (index) { - var insurerName = - getCardArrays[index] - ['insurerName']; - var policyDetails = - getCardArrays[index] - ['policyDetails']; - - // Determine the color for the policyDetails based on the index of the card in getCardArrays - var cardColorIndex = - getCardArrays.indexOf( - getCardArrays[index]) % - cardColors.length; - var cardColor = - cardColors[cardColorIndex]; - - return Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Text( - insurerName, - style: GoogleFonts.poppins( - fontSize: 18, - fontWeight: FontWeight.w600, - color: Colors.black, - ), - ), - SizedBox(height: 8), - SingleChildScrollView( - scrollDirection: - Axis.horizontal, - controller: - ScrollController(), // Adding ScrollController - dragStartBehavior: - DragStartBehavior.start, - child: Row( - children: List.generate( - policyDetails.length, - (index) => Container( - width: 300, - height: policyHeight, - child: GestureDetector( - onTap: () { - Navigator.pushNamed( - context, - 'hrPolicyDetails', - arguments: - policyDetails[ - index]); - }, - child: MouseRegion( - cursor: - SystemMouseCursors - .click, - child: Card( - elevation: 3, - color: - cardColor, // Use the determined color - child: Column( - crossAxisAlignment: - CrossAxisAlignment - .start, - children: [ - ListTile( - title: - SizedBox( - height: - 50, - child: - Text( - '${policyDetails[index]['policy_name']} - (${policyDetails[index]['type']})', - style: GoogleFonts - .poppins( - fontSize: - 16, - fontWeight: - FontWeight.w500, - color: - Color(0xFF000000), + Expanded( + child: + SingleChildScrollView( + scrollDirection: + Axis.horizontal, + controller: + _scrollController, + dragStartBehavior: + DragStartBehavior + .start, + child: Row( + children: List.generate( + policyDetails.length, + (index) => Container( + width: 300, + height: + policyHeight, + child: + GestureDetector( + onTap: () { + Navigator.pushNamed( + context, + 'hrPolicyDetails', + arguments: + policyDetails[ + index]); + }, + child: + MouseRegion( + cursor: + SystemMouseCursors + .click, + child: Card( + elevation: 3, + color: + cardColor, + child: Column( + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + ListTile( + title: + SizedBox( height: - 1.5, + 50, + child: + Text( + '${policyDetails[index]['policy_name']} - (${policyDetails[index]['type']})', + style: + GoogleFonts.poppins( + fontSize: 16, + fontWeight: FontWeight.w500, + color: Color(0xFF000000), + height: 1.5, + ), + softWrap: + true, + ), ), - softWrap: - true, // Allow text to wrap to the next line if needed ), - ), + SizedBox( + height: + 8), + Padding( + padding: EdgeInsets.only( + left: + 15, + right: + 15), + child: + Row( + children: [ + Expanded( + flex: 4, + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text( + 'Draft', + style: GoogleFonts.poppins( + fontSize: 16, + fontWeight: FontWeight.w500, + color: Color(0xFF000000), + height: 1.5, + ), + ), + Text( + policyDetails[index]['membersCountOfDraft'].toString(), + style: GoogleFonts.poppins( + fontSize: 16, + fontWeight: FontWeight.w400, + color: Color(0xFF000000), + height: 1.5, + ), + ), + ], + ), + ), + Expanded( + flex: 4, + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text( + 'Enrolled', + style: GoogleFonts.poppins( + fontSize: 16, + fontWeight: FontWeight.w500, + color: Color(0xFF000000), + height: 1.5, + ), + ), + Text( + policyDetails[index]['membersCountOfEnrolled'].toString(), + style: GoogleFonts.poppins( + fontSize: 16, + fontWeight: FontWeight.w400, + color: Color(0xFF000000), + height: 1.5, + ), + ), + ], + ), + ), + Expanded( + flex: 4, + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text( + 'Total', + style: GoogleFonts.poppins( + fontSize: 16, + fontWeight: FontWeight.w500, + color: Color(0xFF000000), + height: 1.5, + ), + ), + Text( + policyDetails[index]['totalMembersCount'].toString(), + style: GoogleFonts.poppins( + fontSize: 16, + fontWeight: FontWeight.w400, + color: Color(0xFF000000), + height: 1.5, + ), + ), + ], + ), + ), + ], + ), + ), + ], ), - SizedBox( - height: - 8), - Padding( - padding: EdgeInsets.only( - left: - 15, - right: - 15), - child: Row( - children: [ - Expanded( - flex: - 4, - child: - Column( - crossAxisAlignment: - CrossAxisAlignment.center, - children: [ - Text( - 'Draft', - style: GoogleFonts.poppins( - fontSize: 16, - fontWeight: FontWeight.w500, - color: Color(0xFF000000), - height: 1.5, - ), - ), - Text( - policyDetails[index]['membersCountOfDraft'].toString(), - style: GoogleFonts.poppins( - fontSize: 16, - fontWeight: FontWeight.w400, - color: Color(0xFF000000), - height: 1.5, - ), - ), - ], - ), - ), - Expanded( - flex: - 4, - child: - Column( - crossAxisAlignment: - CrossAxisAlignment.center, - children: [ - Text( - 'Enrolled', - style: GoogleFonts.poppins( - fontSize: 16, - fontWeight: FontWeight.w500, - color: Color(0xFF000000), - height: 1.5, - ), - ), - Text( - policyDetails[index]['membersCountOfEnrolled'].toString(), - style: GoogleFonts.poppins( - fontSize: 16, - fontWeight: FontWeight.w400, - color: Color(0xFF000000), - height: 1.5, - ), - ), - ], - ), - ), - Expanded( - flex: - 4, - child: - Column( - crossAxisAlignment: - CrossAxisAlignment.center, - children: [ - Text( - 'Total', - style: GoogleFonts.poppins( - fontSize: 16, - fontWeight: FontWeight.w500, - color: Color(0xFF000000), - height: 1.5, - ), - ), - Text( - policyDetails[index]['totalMembersCount'].toString(), - style: GoogleFonts.poppins( - fontSize: 16, - fontWeight: FontWeight.w400, - color: Color(0xFF000000), - height: 1.5, - ), - ), - ], - ), - ), - ], - ), // Adjust the horizontal padding as needed - ) - ], + ), ), ), ), @@ -620,26 +639,43 @@ class _hrDashboardState extends State { ), ), ), - ), - SizedBox(height: 20), - ], - ); - }, - ), + IconButton( + icon: Icon( + Icons.arrow_forward), + onPressed: () { + _scrollController + .animateTo( + _scrollController + .offset + + 300, + duration: Duration( + milliseconds: 500), + curve: Curves.easeInOut, + ); + }, + ), + ], + ), + SizedBox(height: 20), + ], + ); + }, ), ), - ], - ) - ], - ), - )) + ), + ], + ), + ], + ), + ), + ) ], ), ), ), if (isLoading) Container( - color: Color(0xFFFFFCE5), // Semi-transparent background + color: Color(0x98FFFCE5), // Semi-transparent background child: Center( child: // Your GIF loader widget Image.asset( @@ -648,6 +684,13 @@ class _hrDashboardState extends State { 'assets/nhance-loader.gif'), // Adjust path to your GIF loader ), ), + Align( + alignment: Alignment.bottomCenter, + child: Container( + width: double.infinity, // Make the footer full width + child: CustomFooter(), + ), + ), ])); } } diff --git a/lib/hrLogin.dart b/lib/hrLogin.dart index 6a968bf..ebd91b3 100644 --- a/lib/hrLogin.dart +++ b/lib/hrLogin.dart @@ -267,7 +267,7 @@ class _MyPhoneState extends State { return Image.asset( 'assets/hrLogin.jpg', height: _size.height, - fit: BoxFit.fill, + fit: BoxFit.cover, ); } else { return SizedBox(); @@ -327,23 +327,23 @@ class _MyPhoneState extends State { flex: 8, child: Align( alignment: Alignment - .centerRight, // Align to the start + .topRight, // Align to the start child: _size.width <= 1100 ? Image.asset( 'assets/Nhance-Logo-Final-mobile.png', width: 150, - height: 150, + height: 70, ) : _size.width > 1100 ? Image.asset( 'assets/Nhance-Logo-Final 1.png', width: 150, - height: 150, + height: 70, ) : Image.asset( 'assets/Nhance-Logo-Final 1.png', width: 150, - height: 150, + height: 70, ), )), ], @@ -598,42 +598,49 @@ class _MyPhoneState extends State { SizedBox( height: _size.height * 0.1, ), - Container( + Align( alignment: Alignment.bottomCenter, - padding: - EdgeInsets.symmetric(vertical: 8), - child: RichText( - textAlign: TextAlign.center, - text: TextSpan( - text: - 'By continuing, you agree with our ', - style: TextStyle( - color: Colors.black, - fontSize: 9, - ), - children: [ - TextSpan( - text: 'privacy policy ', - style: TextStyle( - color: Color(0xFF00989E), - fontSize: 9, - ), - ), - TextSpan( - text: 'and ', - style: TextStyle( + child: Container( + width: double + .infinity, // Make the footer full width + child: Container( + alignment: Alignment.bottomCenter, + padding: + EdgeInsets.symmetric(vertical: 8), + child: RichText( + textAlign: TextAlign.center, + text: TextSpan( + text: + 'By continuing, you agree with our ', + style: GoogleFonts.poppins( color: Colors.black, fontSize: 9, ), + children: [ + TextSpan( + text: 'privacy policy ', + style: GoogleFonts.poppins( + color: Color(0xFF00989E), + fontSize: 9, + ), + ), + TextSpan( + text: 'and ', + style: GoogleFonts.poppins( + color: Colors.black, + fontSize: 9, + ), + ), + TextSpan( + text: 'terms of use', + style: GoogleFonts.poppins( + color: Color(0xFF00989E), + fontSize: 9, + ), + ), + ], ), - TextSpan( - text: 'terms of use', - style: TextStyle( - color: Color(0xFF00989E), - fontSize: 9, - ), - ), - ], + ), ), ), ), diff --git a/lib/hrPolicyDetails.dart b/lib/hrPolicyDetails.dart index e3effa7..b6665c6 100644 --- a/lib/hrPolicyDetails.dart +++ b/lib/hrPolicyDetails.dart @@ -19,6 +19,8 @@ import 'package:excel/excel.dart'; import 'package:path_provider/path_provider.dart'; import 'package:path/path.dart' as path; +import 'customAppBar/customFooter.dart'; + class hrPolicyDetails extends StatefulWidget { const hrPolicyDetails({Key? key}) : super(key: key); @@ -31,6 +33,7 @@ class _HrPolicyDetailsState extends State Uint8List? fileBytes; late String _token; List> getEmpDependenceByClintId = []; + bool isLoading = false; bool _isLoading = false; // dynamic clintID; late TabController _tabController; @@ -133,6 +136,7 @@ class _HrPolicyDetailsState extends State } Future getEmployeeAndDependence(clintID, getPolicyNo) async { + isLoading = true; setState(() { _isLoading = true; }); @@ -140,6 +144,7 @@ class _HrPolicyDetailsState extends State final response = await apiService.getEmployeeAndDependenceToApi( clintID!, getPolicyNo!, empRefId!); if (response['status'] == 'success') { + isLoading = false; setState(() { getEmpDependenceByClintId = List>.from(response['data']); @@ -293,176 +298,336 @@ class _HrPolicyDetailsState extends State if (filteredData == []) { return Scaffold( appBar: CustomAppBar(), - body: SingleChildScrollView( - child: Container( - color: Color(0xFFEFF3F6), - child: Column( - children: [ - Center( - child: Text('No Data Available'), - ) - ], - ), - ), - )); - } else { - return Scaffold( - appBar: CustomAppBar(), - body: Container( - padding: const EdgeInsets.all(20), - color: Color(0xFFEFF3F6), - child: Card( - elevation: 0, - child: SingleChildScrollView( + body: Stack(children: [ + SingleChildScrollView( + child: Container( + color: Color(0xFFEFF3F6), child: Column( children: [ Center( - child: Padding( - padding: const EdgeInsets.all(20), - child: _isLoading - ? Center(child: CircularProgressIndicator()) - : originalData.isNotEmpty - ? SingleChildScrollView( - child: Column( - children: [ - Container( - padding: EdgeInsets.all( - 10), // Set your desired padding - color: Color( - 0xFFE26728), // Set your desired background color - child: Row( - children: [ - Expanded( - flex: 6, - child: Container( - alignment: Alignment - .centerLeft, // Align text to the center - child: Text( - '$policyName - ($policyType)', - textAlign: TextAlign - .center, // Align text to the center - style: GoogleFonts.poppins( - fontSize: 16, - fontWeight: FontWeight.w500, - color: Colors.white, - ), - ), - ), - ), - Expanded( - flex: 6, - child: Container( - alignment: Alignment - .centerRight, // Align text to the center - child: MouseRegion( - cursor: - SystemMouseCursors.click, - child: GestureDetector( - onTap: () { - Navigator.pushNamed( - context, - 'hrDashboard'); - }, - child: Icon( - Icons - .close, // Replace with your desired icon - color: Colors - .white, // Replace with your desired icon color + child: Text('No Data Available'), + ) + ], + ), + ), + ), + if (isLoading) + Container( + color: Color(0x98FFFCE5), // Semi-transparent background + child: Center( + child: // Your GIF loader widget + Image.asset( + height: 60, + width: 60, + 'assets/nhance-loader.gif'), // Adjust path to your GIF loader + ), + ), + Align( + alignment: Alignment.bottomCenter, + child: Container( + width: double.infinity, // Make the footer full width + child: CustomFooter(), + ), + ), + ])); + } else { + return Scaffold( + appBar: CustomAppBar(), + body: Stack(children: [ + Container( + padding: const EdgeInsets.all(20), + color: Color(0xFFEFF3F6), + child: Card( + elevation: 0, + color: Colors.white, + child: SingleChildScrollView( + child: Column( + children: [ + Center( + child: Padding( + padding: const EdgeInsets.all(20), + child: _isLoading + ? Center(child: CircularProgressIndicator()) + : originalData.isNotEmpty + ? SingleChildScrollView( + child: Column( + children: [ + Container( + padding: EdgeInsets.all( + 10), // Set your desired padding + color: Color( + 0xFFE26728), // Set your desired background color + child: Row( + children: [ + Expanded( + flex: 6, + child: Container( + alignment: Alignment + .centerLeft, // Align text to the center + child: Text( + '$policyName - ($policyType)', + textAlign: TextAlign + .center, // Align text to the center + style: + GoogleFonts.poppins( + fontSize: 16, + fontWeight: + FontWeight.w500, + color: Colors.white, + ), ), ), ), - ), + Expanded( + flex: 6, + child: Container( + alignment: Alignment + .centerRight, // Align text to the center + child: MouseRegion( + cursor: SystemMouseCursors + .click, + child: GestureDetector( + onTap: () { + Navigator.pushNamed( + context, + 'hrDashboard'); + }, + child: Icon( + Icons + .close, // Replace with your desired icon + color: Colors + .white, // Replace with your desired icon color + ), + ), + ), + ), + ), + ], ), - ], - ), - ), - SizedBox(height: 20), - Row( - children: [ - Expanded( - flex: (policyType == 'GPA' || - policyType == 'GMC') - ? 8 - : 10, - child: Container( - alignment: Alignment.centerLeft, + ), + SizedBox(height: 20), + Row( + children: [ + Expanded( + flex: (policyType == 'GPA' || + policyType == 'GMC') + ? 8 + : 10, child: Container( - width: - 350, // Set your desired width here - height: - 40, // Set your desired height here - decoration: BoxDecoration( - boxShadow: [ - BoxShadow( - color: Color.fromRGBO( - 255, - 255, - 255, - 0.5), // Shadow color with opacity - offset: Offset(5, - 5), // Shadow position (horizontal, vertical) - blurRadius: - 10, // Blur radius - spreadRadius: - 0, // Spread radius + alignment: + Alignment.centerLeft, + child: Container( + width: + 350, // Set your desired width here + height: + 40, // Set your desired height here + decoration: BoxDecoration( + boxShadow: [ + BoxShadow( + color: Color.fromRGBO( + 255, + 255, + 255, + 0.5), // Shadow color with opacity + offset: Offset(5, + 5), // Shadow position (horizontal, vertical) + blurRadius: + 10, // Blur radius + spreadRadius: + 0, // Spread radius + ), + ], + borderRadius: + BorderRadius + .circular(5), + ), + child: TextField( + textAlignVertical: + TextAlignVertical + .center, // Center the text vertically + decoration: + InputDecoration( + hintText: 'Search', + suffixIcon: Icon( + Icons.search), + contentPadding: + EdgeInsets.all( + 10), // Adjust the horizontal padding + border: + OutlineInputBorder( + borderSide: BorderSide( + color: Color( + 0xFFf5f5f7)), // Set border color to gray + ), + ), + controller: + searchController, + onChanged: + search, // Call the search method on text change + ), + )), + ), + Expanded( + flex: 2, + child: Container( + alignment: + Alignment.centerRight, + child: Row( + mainAxisAlignment: + MainAxisAlignment + .center, + children: [ + Expanded( + child: ElevatedButton( + onPressed: () => + {downloadExcel()}, + child: Text( + 'Export', + style: TextStyle( + color: Colors + .white), + ), + style: ElevatedButton + .styleFrom( + backgroundColor: + Color( + 0xFFE26728), + shape: + RoundedRectangleBorder( + borderRadius: + BorderRadius + .circular( + 5), + ), + ), + ), ), ], - borderRadius: - BorderRadius.circular( - 5), ), - child: TextField( - textAlignVertical: - TextAlignVertical - .center, // Center the text vertically - decoration: InputDecoration( - hintText: 'Search', - suffixIcon: - Icon(Icons.search), - contentPadding: - EdgeInsets.all( - 10), // Adjust the horizontal padding - border: - OutlineInputBorder( - borderSide: BorderSide( - color: Color( - 0xFFf5f5f7)), // Set border color to gray - ), + ), + ), + SizedBox( + width: (policyType == 'GPA' || + policyType == 'GMC') + ? 5 + : 0), + if ((policyType == 'GPA' || + policyType == 'GMC') && + inceptionType == 2) + Expanded( + flex: 2, + child: Container( + alignment: + Alignment.centerRight, + child: Row( + mainAxisAlignment: + MainAxisAlignment + .center, + children: [ + Expanded( + child: ElevatedButton( + onPressed: () => + _uploadFile( + policyType), + child: Text( + 'Import Data', + style: TextStyle( + color: Colors + .white), + ), + style: + ElevatedButton + .styleFrom( + backgroundColor: + Color( + 0xFFE26728), + shape: + RoundedRectangleBorder( + borderRadius: + BorderRadius + .circular( + 5), + ), + ), + ), + ), + ], ), - controller: - searchController, - onChanged: - search, // Call the search method on text change ), - )), + ), + ], ), - Expanded( - flex: 2, - child: Container( - alignment: Alignment.centerRight, + SizedBox(height: 20), + Row( + children: [ + Expanded( + child: SingleChildScrollView( + child: _buildDataTableGPA( + context), + ), + ) + ], + ), + ], + )) + : Container( + height: + MediaQuery.of(context).size.height, + child: Column( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + Container( + padding: EdgeInsets.all( + 10), // Set your desired padding + color: Color( + 0xFFE26728), // Set your desired background color child: Row( - mainAxisAlignment: - MainAxisAlignment.center, children: [ Expanded( - child: ElevatedButton( - onPressed: () => - {downloadExcel()}, + flex: 6, + child: Container( + alignment: Alignment + .centerLeft, // Align text to the center child: Text( - 'Export', - style: TextStyle( - color: - Colors.white), + (policyName != null && + policyType != + null) + ? '$policyName - ($policyType)' + : '', + textAlign: TextAlign + .center, // Align text to the center + style: + GoogleFonts.poppins( + fontSize: 16, + fontWeight: + FontWeight.w500, + color: Colors.white, + ), ), - style: ElevatedButton - .styleFrom( - backgroundColor: - Color(0xFFE26728), - shape: - RoundedRectangleBorder( - borderRadius: - BorderRadius - .circular(5), + ), + ), + Expanded( + flex: 6, + child: Container( + alignment: Alignment + .centerRight, // Align text to the center + child: MouseRegion( + cursor: + SystemMouseCursors + .click, + child: GestureDetector( + onTap: () { + Navigator.pushNamed( + context, + 'hrDashboard'); + }, + child: Icon( + Icons + .close, // Replace with your desired icon + color: Colors + .white, // Replace with your desired icon color + ), ), ), ), @@ -470,172 +635,70 @@ class _HrPolicyDetailsState extends State ], ), ), - ), - SizedBox( - width: (policyType == 'GPA' || - policyType == 'GMC') - ? 5 - : 0), - if ((policyType == 'GPA' || - policyType == 'GMC') && - inceptionType == 2) - Expanded( - flex: 2, - child: Container( - alignment: - Alignment.centerRight, - child: Row( - mainAxisAlignment: - MainAxisAlignment.center, - children: [ - Expanded( - child: ElevatedButton( - onPressed: () => - _uploadFile( - policyType), - child: Text( - 'Import Data', - style: TextStyle( - color: - Colors.white), - ), - style: ElevatedButton - .styleFrom( - backgroundColor: - Color(0xFFE26728), - shape: - RoundedRectangleBorder( - borderRadius: - BorderRadius - .circular( - 5), - ), - ), - ), - ), - ], - ), - ), - ), - ], - ), - SizedBox(height: 20), - Row( - children: [ - Expanded( - child: SingleChildScrollView( - child: - _buildDataTableGPA(context), - ), - ) - ], - ), - ], - )) - : Container( - height: MediaQuery.of(context).size.height, - child: Column( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - Container( - padding: EdgeInsets.all( - 10), // Set your desired padding - color: Color( - 0xFFE26728), // Set your desired background color - child: Row( - children: [ - Expanded( - flex: 6, - child: Container( - alignment: Alignment - .centerLeft, // Align text to the center + SizedBox(height: 200), + if (inceptionType == 2) + Center( + child: ElevatedButton( + onPressed: () => + _uploadFile(policyType), child: Text( - (policyName != null && - policyType != null) - ? '$policyName - ($policyType)' - : '', - textAlign: TextAlign - .center, // Align text to the center - style: GoogleFonts.poppins( - fontSize: 16, - fontWeight: - FontWeight.w500, - color: Colors.white, + 'Import Data', + style: TextStyle( + color: Colors.white), + ), + style: + ElevatedButton.styleFrom( + backgroundColor: + Color(0xFFE26728), + shape: + RoundedRectangleBorder( + borderRadius: + BorderRadius.circular( + 5), ), ), ), - ), - Expanded( - flex: 6, - child: Container( - alignment: Alignment - .centerRight, // Align text to the center - child: MouseRegion( - cursor: SystemMouseCursors - .click, - child: GestureDetector( - onTap: () { - Navigator.pushNamed( - context, - 'hrDashboard'); - }, - child: Icon( - Icons - .close, // Replace with your desired icon - color: Colors - .white, // Replace with your desired icon color - ), - ), + ) + else + Center( + child: Text( + 'No Data Available', + style: GoogleFonts.poppins( + fontSize: 16, + letterSpacing: 0, + color: Colors.black, + fontWeight: FontWeight.w300, ), ), - ), - ], - ), + ) + ], ), - SizedBox(height: 200), - if (inceptionType == 2) - Center( - child: ElevatedButton( - onPressed: () => - _uploadFile(policyType), - child: Text( - 'Import Data', - style: TextStyle( - color: Colors.white), - ), - style: ElevatedButton.styleFrom( - backgroundColor: - Color(0xFFE26728), - shape: RoundedRectangleBorder( - borderRadius: - BorderRadius.circular(5), - ), - ), - ), - ) - else - Center( - child: Text( - 'No Data Available', - style: GoogleFonts.poppins( - fontSize: 16, - letterSpacing: 0, - color: Colors.black, - fontWeight: FontWeight.w300, - ), - ), - ) - ], - ), - ), - ), + ), + ), + ), + ], ), - ], + )), + ), + if (isLoading) + Container( + color: Color(0x98FFFCE5), // Semi-transparent background + child: Center( + child: // Your GIF loader widget + Image.asset( + height: 60, + width: 60, + 'assets/nhance-loader.gif'), // Adjust path to your GIF loader ), - )), - ), - ); + ), + Align( + alignment: Alignment.bottomCenter, + child: Container( + width: double.infinity, // Make the footer full width + child: CustomFooter(), + ), + ), + ])); } } @@ -645,7 +708,8 @@ class _HrPolicyDetailsState extends State return Text('No available data'); } else { return Card( - elevation: 0, // Set elevation to 0 for no shadow + elevation: 0, + color: Colors.white, // Set elevation to 0 for no shadow child: PaginatedDataTable( rowsPerPage: 25, // Adjust rows per page as needed columns: [ diff --git a/lib/hrVerify.dart b/lib/hrVerify.dart index 7de0e2c..f933648 100644 --- a/lib/hrVerify.dart +++ b/lib/hrVerify.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:google_fonts/google_fonts.dart'; import 'package:nhancepolicy/customAppBar/toastHelper.dart'; import 'package:nhancepolicy/models/environment.dart'; import 'package:pinput/pinput.dart'; @@ -404,7 +405,7 @@ class _MyVerifyState extends State { return Image.asset( 'assets/hrLogin.jpg', height: _size.height, - fit: BoxFit.fill, + fit: BoxFit.cover, ); } else { return SizedBox(); @@ -429,23 +430,23 @@ class _MyVerifyState extends State { flex: 8, child: Align( alignment: Alignment - .centerRight, // Align to the start + .topRight, // Align to the start child: _size.width <= 1100 ? Image.asset( 'assets/Nhance-Logo-Final-mobile.png', width: 150, - height: 150, + height: 70, ) : _size.width > 1100 ? Image.asset( 'assets/Nhance-Logo-Final 1.png', width: 150, - height: 150, + height: 70, ) : Image.asset( 'assets/Nhance-Logo-Final 1.png', width: 150, - height: 150, + height: 70, ), )), ], @@ -462,7 +463,7 @@ class _MyVerifyState extends State { children: [ Text( "Welcome to Nhance", - style: TextStyle( + style: GoogleFonts.poppins( fontSize: 16, fontWeight: FontWeight.bold, ), @@ -481,14 +482,14 @@ class _MyVerifyState extends State { text: TextSpan( text: "Please enter the one-time usage code sent to your mobile number $mobileNumber", - style: TextStyle( + style: GoogleFonts.poppins( fontSize: 12, height: 1.5, color: Color(0xFF000000)), children: [ TextSpan( text: " (Change Number)", - style: TextStyle( + style: GoogleFonts.poppins( fontSize: 12, color: Color( 0xFFE26728)), // Change color as desired @@ -531,7 +532,7 @@ class _MyVerifyState extends State { _isTimerRunning ? Text( "Resend OTP in $_secondsRemaining seconds", - style: TextStyle( + style: GoogleFonts.poppins( color: Colors.black), ) : InkWell( @@ -540,7 +541,7 @@ class _MyVerifyState extends State { }, child: Text( "Resend OTP", - style: TextStyle( + style: GoogleFonts.poppins( color: Colors.blue), ), ), @@ -574,7 +575,7 @@ class _MyVerifyState extends State { }, child: Text( "Submit", - style: TextStyle( + style: GoogleFonts.poppins( color: Color(0xFFFFFFFF)), ), ), @@ -592,7 +593,7 @@ class _MyVerifyState extends State { SizedBox(height: 30), Text( "Benefits of Login", - style: TextStyle( + style: GoogleFonts.poppins( fontSize: 20, fontWeight: FontWeight.bold, ), @@ -687,42 +688,49 @@ class _MyVerifyState extends State { SizedBox( height: _size.height * 0.1, ), - Container( + Align( alignment: Alignment.bottomCenter, - padding: - EdgeInsets.symmetric(vertical: 8), - child: RichText( - textAlign: TextAlign.center, - text: TextSpan( - text: - 'By continuing, you agree with our ', - style: TextStyle( - color: Colors.black, - fontSize: 9, - ), - children: [ - TextSpan( - text: 'privacy policy ', - style: TextStyle( - color: Color(0xFF00989E), - fontSize: 9, - ), - ), - TextSpan( - text: 'and ', - style: TextStyle( + child: Container( + width: double + .infinity, // Make the footer full width + child: Container( + alignment: Alignment.bottomCenter, + padding: + EdgeInsets.symmetric(vertical: 8), + child: RichText( + textAlign: TextAlign.center, + text: TextSpan( + text: + 'By continuing, you agree with our ', + style: GoogleFonts.poppins( color: Colors.black, fontSize: 9, ), + children: [ + TextSpan( + text: 'privacy policy ', + style: GoogleFonts.poppins( + color: Color(0xFF00989E), + fontSize: 9, + ), + ), + TextSpan( + text: 'and ', + style: GoogleFonts.poppins( + color: Colors.black, + fontSize: 9, + ), + ), + TextSpan( + text: 'terms of use', + style: GoogleFonts.poppins( + color: Color(0xFF00989E), + fontSize: 9, + ), + ), + ], ), - TextSpan( - text: 'terms of use', - style: TextStyle( - color: Color(0xFF00989E), - fontSize: 9, - ), - ), - ], + ), ), ), ), diff --git a/lib/phone.dart b/lib/phone.dart index e46015f..4e3c5d1 100644 --- a/lib/phone.dart +++ b/lib/phone.dart @@ -273,25 +273,25 @@ class _MyPhoneState extends State { child: Align( alignment: Responsive.isDesktop( context) - ? Alignment.centerLeft + ? Alignment.topLeft : Alignment .bottomCenter, // Align to the start child: _size.width <= 1100 ? Image.asset( 'assets/Nhance-Logo-Final-mobile.png', width: 150, - height: 150, + height: 70, ) : _size.width > 1100 ? Image.asset( 'assets/Nhance-Logo-Final 1.png', width: 150, - height: 150, + height: 70, ) : Image.asset( 'assets/Nhance-Logo-Final 1.png', width: 150, - height: 150, + height: 70, ), )), Expanded( @@ -581,42 +581,49 @@ class _MyPhoneState extends State { SizedBox( height: _size.height * 0.1, ), - Container( + Align( alignment: Alignment.bottomCenter, - padding: - EdgeInsets.symmetric(vertical: 8), - child: RichText( - textAlign: TextAlign.center, - text: TextSpan( - text: - 'By continuing, you agree with our ', - style: GoogleFonts.poppins( - color: Colors.black, - fontSize: 9, - ), - children: [ - TextSpan( - text: 'privacy policy ', - style: GoogleFonts.poppins( - color: Color(0xFF00989E), - fontSize: 9, - ), - ), - TextSpan( - text: 'and ', + child: Container( + width: double + .infinity, // Make the footer full width + child: Container( + alignment: Alignment.bottomCenter, + padding: + EdgeInsets.symmetric(vertical: 8), + child: RichText( + textAlign: TextAlign.center, + text: TextSpan( + text: + 'By continuing, you agree with our ', style: GoogleFonts.poppins( color: Colors.black, fontSize: 9, ), + children: [ + TextSpan( + text: 'privacy policy ', + style: GoogleFonts.poppins( + color: Color(0xFF00989E), + fontSize: 9, + ), + ), + TextSpan( + text: 'and ', + style: GoogleFonts.poppins( + color: Colors.black, + fontSize: 9, + ), + ), + TextSpan( + text: 'terms of use', + style: GoogleFonts.poppins( + color: Color(0xFF00989E), + fontSize: 9, + ), + ), + ], ), - TextSpan( - text: 'terms of use', - style: GoogleFonts.poppins( - color: Color(0xFF00989E), - fontSize: 9, - ), - ), - ], + ), ), ), ), diff --git a/lib/service/api_service.dart b/lib/service/api_service.dart index 56b1f2e..96bb740 100644 --- a/lib/service/api_service.dart +++ b/lib/service/api_service.dart @@ -32,7 +32,7 @@ class ApiService { final url = Uri.parse( '${Environment.apiUrl}getClientDetails?client_id=$clientId&emp_code=$empCode&client_branch_id=$branchID'); final headers = { - 'Authorization': _token ?? '', + 'Authorization': 'Bearer $_token' ?? '', }; final response = await _makeGetRequest(url, headers); return response; @@ -47,7 +47,7 @@ class ApiService { final url = Uri.parse( '${Environment.apiUrl}getEmployeeProfile?emp_code=$empCode&client_id=$clientId&client_branch_id=$branchID'); final headers = { - 'Authorization': _token ?? '', + 'Authorization': 'Bearer $_token' ?? '', }; final response = await _makeGetRequest(url, headers); return response; @@ -60,7 +60,7 @@ class ApiService { } final url = Uri.parse('${Environment.apiUrl}relationshipList'); final headers = { - 'Authorization': _token ?? '', + 'Authorization': 'Bearer $_token' ?? '', }; final response = await _makeGetRequest(url, headers); return response; @@ -75,7 +75,7 @@ class ApiService { final url = Uri.parse( '${Environment.apiUrl}getEmployeePolicy?id=$empPrimaryId&emp_code=$empCode&client_id=$clientId&policy=$policy&client_branch_id=$branchID'); final headers = { - 'Authorization': _token ?? '', + 'Authorization': 'Bearer $_token' ?? '', }; final response = await _makeGetRequest(url, headers); return response; @@ -90,7 +90,7 @@ class ApiService { final url = Uri.parse( '${Environment.apiUrl}getEmployeePolicy?id=$empPrimaryId&emp_code=$empCode&client_id=$clientId&policy=$policy&client_branch_id=$branchID'); final headers = { - 'Authorization': _token ?? '', + 'Authorization': 'Bearer $_token' ?? '', }; final response = await _makeGetRequest(url, headers); return response; @@ -105,7 +105,7 @@ class ApiService { final url = Uri.parse( '${Environment.apiUrl}getAddOnPolicy?client_id=$client_id&emp_code=$emp_code&policy=$policy&client_branch_id=$branchID'); final headers = { - 'Authorization': _token ?? '', + 'Authorization': 'Bearer $_token' ?? '', }; final response = await _makeGetRequest(url, headers); return response; @@ -120,7 +120,7 @@ class ApiService { final url = Uri.parse( '${Environment.apiUrl}getAddOnPolicy?client_id=$client_id&emp_code=$emp_code&policy=$policy&client_branch_id=$branchID'); final headers = { - 'Authorization': _token ?? '', + 'Authorization': 'Bearer $_token' ?? '', }; final response = await _makeGetRequest(url, headers); return response; @@ -135,7 +135,7 @@ class ApiService { final url = Uri.parse( '${Environment.apiUrl}getAddOnPolicy?client_id=$client_id&emp_code=$emp_code&policy=$policy&client_branch_id=$branchID'); final headers = { - 'Authorization': _token ?? '', + 'Authorization': 'Bearer $_token' ?? '', }; final response = await _makeGetRequest(url, headers); return response; @@ -150,7 +150,7 @@ class ApiService { final url = Uri.parse( '${Environment.apiUrl}removeEmpAndEmpPolicyData?emp_code=$empCodeString&client_policy_id=$addOnsDependentClientPolicyId'); final headers = { - 'Authorization': _token ?? '', + 'Authorization': 'Bearer $_token' ?? '', }; final response = await _makeGetRequest(url, headers); return response; @@ -165,7 +165,7 @@ class ApiService { final url = Uri.parse( '${Environment.apiUrl}removeEmpAndEmpPolicyData?emp_code=$empCodeString&client_policy_id=$topUpClientPolicyId'); final headers = { - 'Authorization': _token ?? '', + 'Authorization': 'Bearer $_token' ?? '', }; final response = await _makeGetRequest(url, headers); return response; @@ -180,7 +180,7 @@ class ApiService { final url = Uri.parse( '${Environment.apiUrl}removeEmpAndEmpPolicyData?emp_code=$empCodeString&client_policy_id=$topUpParentClientPolicyId'); final headers = { - 'Authorization': _token ?? '', + 'Authorization': 'Bearer $_token' ?? '', }; final response = await _makeGetRequest(url, headers); return response; @@ -193,7 +193,7 @@ class ApiService { } final url = Uri.parse('${Environment.apiUrl}deleteDependence?id=$id'); final headers = { - 'Authorization': _token ?? '', + 'Authorization': 'Bearer $_token' ?? '', }; final response = await _makeGetRequest(url, headers); return response; @@ -208,7 +208,7 @@ class ApiService { final url = Uri.parse('${Environment.apiUrl}addEmployeeAndDependence'); final headers = { - 'Authorization': _token ?? '', + 'Authorization': 'Bearer $_token' ?? '', 'Content-Type': 'application/json', // Ensure content type is JSON }; @@ -229,7 +229,7 @@ class ApiService { final url = Uri.parse('${Environment.apiUrl}addEmployeeAndDependence'); final headers = { - 'Authorization': _token ?? '', + 'Authorization': 'Bearer $_token' ?? '', 'Content-Type': 'application/json', // Ensure content type is JSON }; @@ -251,7 +251,7 @@ class ApiService { final url = Uri.parse('${Environment.apiUrl}createOrUpdateEmployeePolicySiAmount'); final headers = { - 'Authorization': _token ?? '', + 'Authorization': 'Bearer $_token' ?? '', 'Content-Type': 'application/json', // Ensure content type is JSON }; @@ -273,7 +273,7 @@ class ApiService { final url = Uri.parse('${Environment.apiUrl}createOrUpdateEmployeePolicySiAmount'); final headers = { - 'Authorization': _token ?? '', + 'Authorization': 'Bearer $_token' ?? '', 'Content-Type': 'application/json', // Ensure content type is JSON }; @@ -295,7 +295,7 @@ class ApiService { final url = Uri.parse('${Environment.apiUrl}createOrUpdateEmployeePolicySiAmount'); final headers = { - 'Authorization': _token ?? '', + 'Authorization': 'Bearer $_token' ?? '', 'Content-Type': 'application/json', // Ensure content type is JSON }; @@ -316,7 +316,7 @@ class ApiService { final url = Uri.parse('${Environment.apiUrl}iAgreeForAddOn'); final headers = { - 'Authorization': _token ?? '', + 'Authorization': 'Bearer $_token' ?? '', 'Content-Type': 'application/json', // Ensure content type is JSON }; @@ -336,7 +336,7 @@ class ApiService { final url = Uri.parse('${Environment.apiUrl}calculatePremium'); final headers = { - 'Authorization': _token ?? '', + 'Authorization': 'Bearer $_token' ?? '', 'Content-Type': 'application/json', // Ensure content type is JSON }; @@ -357,7 +357,7 @@ class ApiService { final url = Uri.parse('${Environment.apiUrl}calculatePremium'); final headers = { - 'Authorization': _token ?? '', + 'Authorization': 'Bearer $_token' ?? '', 'Content-Type': 'application/json', // Ensure content type is JSON }; @@ -378,7 +378,7 @@ class ApiService { final url = Uri.parse('${Environment.apiUrl}calculatePremium'); final headers = { - 'Authorization': _token ?? '', + 'Authorization': 'Bearer $_token' ?? '', 'Content-Type': 'application/json', // Ensure content type is JSON }; @@ -401,7 +401,7 @@ class ApiService { final url = Uri.parse( '${Environment.apiUrl}getCashDepositData?client_id=$clintID&client_branch_id=$empRefId'); final headers = { - 'Authorization': _hrtoken ?? '', + 'Authorization': 'Bearer $_hrtoken' ?? '', }; final response = await _makeGetRequest(url, headers); return response; @@ -416,7 +416,7 @@ class ApiService { final url = Uri.parse( '${Environment.apiUrl}getEmployeeAndDependenceByClientId?client_id=$clintID&client_policy_id=$getPolicyNo&client_branch_id=$empRefId'); final headers = { - 'Authorization': _hrtoken ?? '', + 'Authorization': 'Bearer $_hrtoken' ?? '', }; final response = await _makeGetRequest(url, headers); return response; diff --git a/lib/verify.dart b/lib/verify.dart index 6d3cbbb..f3684b3 100644 --- a/lib/verify.dart +++ b/lib/verify.dart @@ -397,25 +397,25 @@ class _MyVerifyState extends State { child: Align( alignment: Responsive.isDesktop( context) - ? Alignment.centerLeft + ? Alignment.topLeft : Alignment .bottomCenter, // Align to the start child: _size.width <= 1100 ? Image.asset( 'assets/Nhance-Logo-Final-mobile.png', width: 150, - height: 150, + height: 70, ) : _size.width > 1100 ? Image.asset( 'assets/Nhance-Logo-Final 1.png', width: 150, - height: 150, + height: 70, ) : Image.asset( 'assets/Nhance-Logo-Final 1.png', width: 150, - height: 150, + height: 70, ), )), ], @@ -658,42 +658,49 @@ class _MyVerifyState extends State { SizedBox( height: _size.height * 0.1, ), - Container( + Align( alignment: Alignment.bottomCenter, - padding: - EdgeInsets.symmetric(vertical: 8), - child: RichText( - textAlign: TextAlign.center, - text: TextSpan( - text: - 'By continuing, you agree with our ', - style: GoogleFonts.poppins( - color: Colors.black, - fontSize: 9, - ), - children: [ - TextSpan( - text: 'privacy policy ', - style: GoogleFonts.poppins( - color: Color(0xFF00989E), - fontSize: 9, - ), - ), - TextSpan( - text: 'and ', + child: Container( + width: double + .infinity, // Make the footer full width + child: Container( + alignment: Alignment.bottomCenter, + padding: + EdgeInsets.symmetric(vertical: 8), + child: RichText( + textAlign: TextAlign.center, + text: TextSpan( + text: + 'By continuing, you agree with our ', style: GoogleFonts.poppins( color: Colors.black, fontSize: 9, ), + children: [ + TextSpan( + text: 'privacy policy ', + style: GoogleFonts.poppins( + color: Color(0xFF00989E), + fontSize: 9, + ), + ), + TextSpan( + text: 'and ', + style: GoogleFonts.poppins( + color: Colors.black, + fontSize: 9, + ), + ), + TextSpan( + text: 'terms of use', + style: GoogleFonts.poppins( + color: Color(0xFF00989E), + fontSize: 9, + ), + ), + ], ), - TextSpan( - text: 'terms of use', - style: GoogleFonts.poppins( - color: Color(0xFF00989E), - fontSize: 9, - ), - ), - ], + ), ), ), ), diff --git a/pubspec.yaml b/pubspec.yaml index 1ed6d9c..cedc3e1 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -53,6 +53,7 @@ dependencies: flutter_animated_button: ^2.0.3 spreadsheet_decoder: ^2.2.0 url_launcher: ^6.2.6 + font_awesome_flutter: ^10.7.0 dev_dependencies: