diff --git a/app_petty_cash/images/logo_excel.png b/app_petty_cash/images/logo_excel.png new file mode 100644 index 0000000..52a4019 Binary files /dev/null and b/app_petty_cash/images/logo_excel.png differ diff --git a/app_petty_cash/images/logo_pdf.png b/app_petty_cash/images/logo_pdf.png new file mode 100644 index 0000000..7578918 Binary files /dev/null and b/app_petty_cash/images/logo_pdf.png differ 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); + } + }, + ), + ), + ], + ), + ), + ), + ), + ), ), ); }