From 15f63232a83ad8c35f09e22748351d9148118729 Mon Sep 17 00:00:00 2001 From: sindhu Date: Mon, 15 Jan 2024 17:02:31 +0700 Subject: [PATCH] step 13 : revisi ui report button pdf & excel --- app_petty_cash/images/logo_excel.png | Bin 0 -> 688 bytes app_petty_cash/images/logo_pdf.png | Bin 0 -> 639 bytes .../lib/screen/report/report_screen.dart | 173 +++++++++++++++--- 3 files changed, 147 insertions(+), 26 deletions(-) create mode 100644 app_petty_cash/images/logo_excel.png create mode 100644 app_petty_cash/images/logo_pdf.png diff --git a/app_petty_cash/images/logo_excel.png b/app_petty_cash/images/logo_excel.png new file mode 100644 index 0000000000000000000000000000000000000000..52a401970ba293db69e310c11c0f5dfbb1108281 GIT binary patch literal 688 zcmV;h0#E&kP)WzvmNd4|fQYqttmw^C4nYt+NsiuvAjN}N#DjRt%}WjhtvqB+-m zdL)a{!nkW19?bRSVs$0ue8Zp&G9}kEdCt9AC|M7zc-Ud=xPY}NUoGde8C8bn(D*0# z_3g)$=lc+^SeeHoA%X~MQLC}kU&%7mg^YuN#&KhRVlyNLyK;zvDG+RGoVu^Gxex$ZS(qf1u zxVl)w(v|yG=)(MsgxJKs4kN%3P%n12$t1(E>?nfuRT%c26J%dWH8+q^E$C*1X1MBR zPB?lw5aKTRqf0g1YTQHP?Q`5bTj8_I(IstASOKl#QzI5!JarCXYYp|~C%FA|9>wX? zI9WImTd4GKN#@l?E+(P+tH-FnY{(;g`u+vQTE&k4D+g>rXiTzLYh$hA-I7U?pCq}P z2MZok_uzmOH2QbV-wt-CT>lm1EwGPM7y^7s0*Yk)e!y?0 WN=Hb7Dq(j30000P000;W1^@s654Bdt00009a7bBm000XU z000XU0RWnu7ytkO0drDELIAGL9O(c600d`2O+f$vv5yPvmz0#2T*_)&Xu(&Hwf8<~Z?ZU$@hqP7;Nzr3 zy@;am0YQk-gI;zM@AunbfP0WoX)uvUbeX347*-Y% zgs8{k87Va;<|?~^SM4UuK;fW1INT{nQdNlbsTDPKDw4@$K$hi!vJk2ef$%Zcc+%Mc z;#F`sG75jkf1GV>A{Ac3qdy@W&CJ1^n$Ayj`28G0Pu)*JC+6ty`QnPLVHnVLofl2h z`eU(JC^sfng6wtoz~}QpdR-3^-2+))2a#nct7}(mB}w9?K<%{fM962?LPN`tGn08& zXysDX_e8F(8u(|wgK#!A7I)9nY-_y)DJ7c1QThqMp7Ia^8#1ZiQxlU&N46~4+k%{H zI!|w7cFvN$Er{c}ADPHDL{+t9Zwtbdjzl=@&LAu%+4uoH%^k+%lwK?DUu`@tEcn@Y z9B0cbw+lHL8|SBCO4G#+3MGmHt+%hFy@+dwrR~Y+INZTD)PDPt@6YbXd8WC(e!dxm z0oYCJY-+d!U}6d24*o1V*Rs2qdzjzle}8dZSw2anomP|W|K!0zs<~^}>O-Pf>|ufX Z)CFE{w&+MoJ~jXV002ovPDHLkV1ly{APfKi literal 0 HcmV?d00001 diff --git a/app_petty_cash/lib/screen/report/report_screen.dart b/app_petty_cash/lib/screen/report/report_screen.dart index bb7d928..6fa2e5c 100644 --- a/app_petty_cash/lib/screen/report/report_screen.dart +++ b/app_petty_cash/lib/screen/report/report_screen.dart @@ -242,37 +242,158 @@ class ReportScreen extends HookConsumerWidget { ), ], ), - - SizedBox( - height: Constant.getActualYPhone(context: context, y: 35), - ), - - Container( - width: Constant.getActualXPhone(context: context, x: 390), - height: Constant.getActualYPhone(context: context, y: 42), - child: ElevatedButton( - child: Text( - 'Laporan', - style: Constant.body1(context: context).copyWith( - fontWeight: FontWeight.w600, - color: Constant.textBlack), - ), - onPressed: () async { - // https://pub.dev/packages?q=url+launcher - String url = "https://pub.dev/packages?q=url+launcher"; - if (!await launchUrl(Uri.parse(url))) { - // throw Exception('Could not launch $url'); - SanckbarWidget(context, 'Could not launch $url', - snackbarType.error); - } - }, - ), - ), ], ), ), ), ), + bottomNavigationBar: Padding( + padding: EdgeInsets.only( + // right: Constant.getActualXPhone(context: context, x: 27), + // left: Constant.getActualXPhone(context: context, x: 27), + // bottom: Constant.getActualYPhone(context: context, y: 32), + top: Constant.getActualYPhone(context: context, y: 10), + ), + child: BottomAppBar( + child: Container( + height: 150, + child: Padding( + padding: EdgeInsets.only( + // right: Constant.getActualXPhone(context: context, x: 27), + // left: Constant.getActualXPhone(context: context, x: 27), + // bottom: Constant.getActualYPhone(context: context, y: 32), + top: Constant.getActualYPhone(context: context, y: 24), + ), + child: Column( + children: [ + // Excel + Container( + width: Constant.getActualXPhone(context: context, x: 336), + height: Constant.getActualYPhone(context: context, y: 42), + child: ElevatedButton( + style: ButtonStyle( + backgroundColor: MaterialStateColor.resolveWith( + (states) => Colors.white), + // side: MaterialStateBorderSide.resolveWith( + // (states) => BorderSide(color: Colors.green), + // ), + + // backgroundColor: MaterialStateColor.resolveWith( + // (st) => Constant.pcBtnBackgroundColor), + shape: + MaterialStateProperty.all( + RoundedRectangleBorder( + borderRadius: BorderRadius.circular(8), + side: BorderSide( + color: Colors.green, + ), + ), + ), + shadowColor: + MaterialStateProperty.all(Color(0xffff48423d)), + elevation: MaterialStateProperty.all(4.0), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Container( + width: Constant.getActualXPhone( + context: context, x: 16), + height: Constant.getActualYPhone( + context: context, y: 16), + // decoration: BoxDecoration(color: Colors.grey), + child: Image.asset( + "images/logo_excel.png", + fit: BoxFit.fill, + // scale: 1, + ), + ), + SizedBox( + height: Constant.getActualXPhone( + context: context, x: 8), + ), + Text( + 'Download Report (xls) ', + style: Constant.body1(context: context).copyWith( + fontWeight: FontWeight.w600, + color: Colors.green, + ), + ), + ], + ), + onPressed: () {}, + ), + ), + + SizedBox( + height: Constant.getActualYPhone(context: context, y: 20), + ), + + // PDF + Container( + width: Constant.getActualXPhone(context: context, x: 336), + height: Constant.getActualYPhone(context: context, y: 42), + child: ElevatedButton( + style: ButtonStyle( + backgroundColor: MaterialStateColor.resolveWith( + (st) => Constant.pcBtnBackgroundColor), + shape: + MaterialStateProperty.all( + RoundedRectangleBorder( + borderRadius: BorderRadius.circular(8), + side: BorderSide( + color: Constant.pcBtnBackgroundColor, + ), + ), + ), + shadowColor: + MaterialStateProperty.all(Color(0xffff48423d)), + elevation: MaterialStateProperty.all(4.0), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Container( + width: Constant.getActualXPhone( + context: context, x: 16), + height: Constant.getActualYPhone( + context: context, y: 16), + // decoration: BoxDecoration(color: Colors.grey), + child: Image.asset( + "images/logo_pdf.png", + fit: BoxFit.fill, + // scale: 1, + ), + ), + SizedBox( + height: Constant.getActualXPhone( + context: context, x: 8), + ), + Text( + 'Download Report (PDF)', + style: Constant.body1(context: context).copyWith( + fontWeight: FontWeight.w600, + color: Constant.white), + ), + ], + ), + onPressed: () async { + String url = + "https://pub.dev/packages?q=url+launcher"; + if (!await launchUrl(Uri.parse(url))) { + // throw Exception('Could not launch $url'); + SanckbarWidget(context, 'Could not launch $url', + snackbarType.error); + } + }, + ), + ), + ], + ), + ), + ), + ), + ), ), ); }