step 13 : revisi ui report button pdf & excel

This commit is contained in:
sindhu
2024-01-15 17:02:31 +07:00
parent ee702da5c7
commit 15f63232a8
3 changed files with 147 additions and 26 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 688 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 639 B

View File

@@ -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>(
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>(
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);
}
},
),
),
],
),
),
),
),
),
),
);
}