Feat: add slicing page Print Boarding Pass
This commit is contained in:
parent
23afed1788
commit
59a0193af1
|
@ -19,6 +19,18 @@
|
||||||
"packageUri": "lib/",
|
"packageUri": "lib/",
|
||||||
"languageVersion": "2.18"
|
"languageVersion": "2.18"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "barcode",
|
||||||
|
"rootUri": "file:///C:/Users/ASUS/AppData/Local/Pub/Cache/hosted/pub.dev/barcode-2.2.9",
|
||||||
|
"packageUri": "lib/",
|
||||||
|
"languageVersion": "2.12"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "barcode_widget",
|
||||||
|
"rootUri": "file:///C:/Users/ASUS/AppData/Local/Pub/Cache/hosted/pub.dev/barcode_widget-2.0.4",
|
||||||
|
"packageUri": "lib/",
|
||||||
|
"languageVersion": "2.12"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "boolean_selector",
|
"name": "boolean_selector",
|
||||||
"rootUri": "file:///C:/Users/ASUS/AppData/Local/Pub/Cache/hosted/pub.dev/boolean_selector-2.1.1",
|
"rootUri": "file:///C:/Users/ASUS/AppData/Local/Pub/Cache/hosted/pub.dev/boolean_selector-2.1.1",
|
||||||
|
@ -325,6 +337,12 @@
|
||||||
"packageUri": "lib/",
|
"packageUri": "lib/",
|
||||||
"languageVersion": "3.0"
|
"languageVersion": "3.0"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "qr",
|
||||||
|
"rootUri": "file:///C:/Users/ASUS/AppData/Local/Pub/Cache/hosted/pub.dev/qr-3.0.2",
|
||||||
|
"packageUri": "lib/",
|
||||||
|
"languageVersion": "3.4"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "shared_preferences",
|
"name": "shared_preferences",
|
||||||
"rootUri": "file:///C:/Users/ASUS/AppData/Local/Pub/Cache/hosted/pub.dev/shared_preferences-2.5.2",
|
"rootUri": "file:///C:/Users/ASUS/AppData/Local/Pub/Cache/hosted/pub.dev/shared_preferences-2.5.2",
|
||||||
|
@ -482,7 +500,7 @@
|
||||||
"languageVersion": "3.4"
|
"languageVersion": "3.4"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"generated": "2025-03-18T16:43:58.907612Z",
|
"generated": "2025-03-18T17:25:46.276961Z",
|
||||||
"generator": "pub",
|
"generator": "pub",
|
||||||
"generatorVersion": "3.5.0",
|
"generatorVersion": "3.5.0",
|
||||||
"flutterRoot": "file:///D:/Flutter/flutter_sdk/flutter_3.24.0",
|
"flutterRoot": "file:///D:/Flutter/flutter_sdk/flutter_3.24.0",
|
||||||
|
|
|
@ -10,6 +10,14 @@ async
|
||||||
2.18
|
2.18
|
||||||
file:///C:/Users/ASUS/AppData/Local/Pub/Cache/hosted/pub.dev/async-2.11.0/
|
file:///C:/Users/ASUS/AppData/Local/Pub/Cache/hosted/pub.dev/async-2.11.0/
|
||||||
file:///C:/Users/ASUS/AppData/Local/Pub/Cache/hosted/pub.dev/async-2.11.0/lib/
|
file:///C:/Users/ASUS/AppData/Local/Pub/Cache/hosted/pub.dev/async-2.11.0/lib/
|
||||||
|
barcode
|
||||||
|
2.12
|
||||||
|
file:///C:/Users/ASUS/AppData/Local/Pub/Cache/hosted/pub.dev/barcode-2.2.9/
|
||||||
|
file:///C:/Users/ASUS/AppData/Local/Pub/Cache/hosted/pub.dev/barcode-2.2.9/lib/
|
||||||
|
barcode_widget
|
||||||
|
2.12
|
||||||
|
file:///C:/Users/ASUS/AppData/Local/Pub/Cache/hosted/pub.dev/barcode_widget-2.0.4/
|
||||||
|
file:///C:/Users/ASUS/AppData/Local/Pub/Cache/hosted/pub.dev/barcode_widget-2.0.4/lib/
|
||||||
boolean_selector
|
boolean_selector
|
||||||
2.17
|
2.17
|
||||||
file:///C:/Users/ASUS/AppData/Local/Pub/Cache/hosted/pub.dev/boolean_selector-2.1.1/
|
file:///C:/Users/ASUS/AppData/Local/Pub/Cache/hosted/pub.dev/boolean_selector-2.1.1/
|
||||||
|
@ -202,6 +210,10 @@ plugin_platform_interface
|
||||||
3.0
|
3.0
|
||||||
file:///C:/Users/ASUS/AppData/Local/Pub/Cache/hosted/pub.dev/plugin_platform_interface-2.1.8/
|
file:///C:/Users/ASUS/AppData/Local/Pub/Cache/hosted/pub.dev/plugin_platform_interface-2.1.8/
|
||||||
file:///C:/Users/ASUS/AppData/Local/Pub/Cache/hosted/pub.dev/plugin_platform_interface-2.1.8/lib/
|
file:///C:/Users/ASUS/AppData/Local/Pub/Cache/hosted/pub.dev/plugin_platform_interface-2.1.8/lib/
|
||||||
|
qr
|
||||||
|
3.4
|
||||||
|
file:///C:/Users/ASUS/AppData/Local/Pub/Cache/hosted/pub.dev/qr-3.0.2/
|
||||||
|
file:///C:/Users/ASUS/AppData/Local/Pub/Cache/hosted/pub.dev/qr-3.0.2/lib/
|
||||||
shared_preferences
|
shared_preferences
|
||||||
3.5
|
3.5
|
||||||
file:///C:/Users/ASUS/AppData/Local/Pub/Cache/hosted/pub.dev/shared_preferences-2.5.2/
|
file:///C:/Users/ASUS/AppData/Local/Pub/Cache/hosted/pub.dev/shared_preferences-2.5.2/
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
|
import 'package:barcode_widget/barcode_widget.dart';
|
||||||
import 'package:e_porter/_core/component/card/custome_shadow_cotainner.dart';
|
import 'package:e_porter/_core/component/card/custome_shadow_cotainner.dart';
|
||||||
|
import 'package:e_porter/_core/component/dotted/dashed_line_component.dart';
|
||||||
import 'package:e_porter/_core/constants/colors.dart';
|
import 'package:e_porter/_core/constants/colors.dart';
|
||||||
import 'package:e_porter/_core/constants/typography.dart';
|
import 'package:e_porter/_core/constants/typography.dart';
|
||||||
import 'package:e_porter/presentation/screens/home/component/card_tickets.dart';
|
import 'package:e_porter/presentation/screens/home/component/card_tickets.dart';
|
||||||
|
@ -16,7 +18,7 @@ class PrintBoardingPassScreen extends StatelessWidget {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
backgroundColor: GrayColors.gray50,
|
backgroundColor: GrayColors.gray50,
|
||||||
appBar: DefaultAppbarComponent(
|
appBar: DefaultAppbarComponent(
|
||||||
title: 'Detail Tiket',
|
title: 'Cetak Boarding Pass',
|
||||||
textColor: Colors.white,
|
textColor: Colors.white,
|
||||||
backgroundColors: PrimaryColors.primary800,
|
backgroundColors: PrimaryColors.primary800,
|
||||||
onTab: () {
|
onTab: () {
|
||||||
|
@ -49,6 +51,7 @@ class PrintBoardingPassScreen extends StatelessWidget {
|
||||||
),
|
),
|
||||||
CardTickets(
|
CardTickets(
|
||||||
withContainer: false,
|
withContainer: false,
|
||||||
|
showFooter: false,
|
||||||
departureCity: 'departureCity',
|
departureCity: 'departureCity',
|
||||||
date: 'date',
|
date: 'date',
|
||||||
arrivalCity: 'arrivalCity',
|
arrivalCity: 'arrivalCity',
|
||||||
|
@ -59,8 +62,25 @@ class PrintBoardingPassScreen extends StatelessWidget {
|
||||||
duration: 'duration',
|
duration: 'duration',
|
||||||
seatClass: 'seatClass',
|
seatClass: 'seatClass',
|
||||||
price: 'price',
|
price: 'price',
|
||||||
onTap: () {},
|
),
|
||||||
)
|
Padding(
|
||||||
|
padding: EdgeInsets.symmetric(vertical: 10),
|
||||||
|
child: Divider(thickness: 1, color: GrayColors.gray200),
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
_buildColumnText(context, label: 'Layanan', value: 'value'),
|
||||||
|
_buildColumnText(context, label: 'Class', value: 'value'),
|
||||||
|
_buildColumnText(context, label: 'Gate', value: 'value'),
|
||||||
|
_buildColumnText(context, label: 'Seat', value: 'value'),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding: EdgeInsets.symmetric(vertical: 20.h),
|
||||||
|
child: CustomDashedLine(),
|
||||||
|
),
|
||||||
|
_buildBarcode(context, barcodeData: 'PK230222BE143')
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
@ -71,4 +91,37 @@ class PrintBoardingPassScreen extends StatelessWidget {
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Widget _buildColumnText(
|
||||||
|
BuildContext context, {
|
||||||
|
required String label,
|
||||||
|
required String value,
|
||||||
|
}) {
|
||||||
|
return Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
TypographyStyles.small(label, color: GrayColors.gray500, fontWeight: FontWeight.w400),
|
||||||
|
TypographyStyles.caption(
|
||||||
|
value,
|
||||||
|
color: GrayColors.gray800,
|
||||||
|
maxlines: 1,
|
||||||
|
)
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _buildBarcode(BuildContext context, {required String barcodeData}) {
|
||||||
|
return Column(
|
||||||
|
children: [
|
||||||
|
BarcodeWidget(
|
||||||
|
barcode: Barcode.code128(),
|
||||||
|
data: barcodeData,
|
||||||
|
height: 80.h,
|
||||||
|
drawText: false,
|
||||||
|
),
|
||||||
|
SizedBox(height: 10.h),
|
||||||
|
TypographyStyles.small(barcodeData, color: GrayColors.gray800, fontWeight: FontWeight.w400)
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,8 +18,9 @@ class CardTickets extends StatelessWidget {
|
||||||
final String duration;
|
final String duration;
|
||||||
final String seatClass;
|
final String seatClass;
|
||||||
final String price;
|
final String price;
|
||||||
final VoidCallback onTap;
|
final VoidCallback? onTap;
|
||||||
final bool withContainer;
|
final bool withContainer;
|
||||||
|
final bool showFooter;
|
||||||
|
|
||||||
const CardTickets({
|
const CardTickets({
|
||||||
Key? key,
|
Key? key,
|
||||||
|
@ -33,13 +34,13 @@ class CardTickets extends StatelessWidget {
|
||||||
required this.duration,
|
required this.duration,
|
||||||
required this.seatClass,
|
required this.seatClass,
|
||||||
required this.price,
|
required this.price,
|
||||||
required this.onTap,
|
this.onTap,
|
||||||
required this.withContainer,
|
this.withContainer = true,
|
||||||
|
this.showFooter = true,
|
||||||
});
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
// Konten utama card
|
|
||||||
Widget content = Column(
|
Widget content = Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
|
@ -77,35 +78,34 @@ class CardTickets extends StatelessWidget {
|
||||||
TypographyStyles.small(arrivalTime, color: GrayColors.gray600, fontWeight: FontWeight.w400),
|
TypographyStyles.small(arrivalTime, color: GrayColors.gray600, fontWeight: FontWeight.w400),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
SizedBox(height: 16.h),
|
if (showFooter) ...[
|
||||||
SvgPicture.asset('assets/images/divider_custome.svg', width: 348.w),
|
SizedBox(height: 16.h),
|
||||||
SizedBox(height: 6.h),
|
SvgPicture.asset('assets/images/divider_custome.svg', width: 348.w),
|
||||||
Row(
|
SizedBox(height: 6.h),
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
Row(
|
||||||
children: [
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
Row(
|
children: [
|
||||||
children: [
|
Row(
|
||||||
CustomeIcons.FlightSeatFilled(),
|
children: [
|
||||||
SizedBox(width: 6.w),
|
CustomeIcons.FlightSeatFilled(),
|
||||||
TypographyStyles.caption(seatClass, color: GrayColors.gray800),
|
SizedBox(width: 6.w),
|
||||||
],
|
TypographyStyles.caption(seatClass, color: GrayColors.gray800),
|
||||||
),
|
],
|
||||||
Row(
|
),
|
||||||
children: [
|
Row(
|
||||||
TypographyStyles.body(price, color: PrimaryColors.primary800),
|
children: [
|
||||||
SizedBox(width: 2.w),
|
TypographyStyles.body(price, color: PrimaryColors.primary800),
|
||||||
TypographyStyles.small('/orang', color: GrayColors.gray600, fontWeight: FontWeight.w400),
|
SizedBox(width: 2.w),
|
||||||
],
|
TypographyStyles.small('/orang', color: GrayColors.gray600, fontWeight: FontWeight.w400),
|
||||||
),
|
],
|
||||||
],
|
),
|
||||||
)
|
],
|
||||||
|
)
|
||||||
|
]
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|
||||||
// Jika withShadow = true, bungkus konten dengan CustomeShadowCotainner
|
Widget finalWidget = withContainer ? CustomeShadowCotainner(child: content) : content;
|
||||||
Widget finalWidget = withContainer
|
|
||||||
? CustomeShadowCotainner(child: content)
|
|
||||||
: content;
|
|
||||||
|
|
||||||
return ZoomTapAnimation(
|
return ZoomTapAnimation(
|
||||||
child: GestureDetector(
|
child: GestureDetector(
|
||||||
|
|
|
@ -124,7 +124,6 @@ class _SearchTicketsScreenState extends State<SearchTicketsScreen> {
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: EdgeInsets.only(bottom: 16.h),
|
padding: EdgeInsets.only(bottom: 16.h),
|
||||||
child: CardTickets(
|
child: CardTickets(
|
||||||
withContainer: true,
|
|
||||||
departureCity: '${flight.cityDeparture} (${flight.codeDeparture})',
|
departureCity: '${flight.cityDeparture} (${flight.codeDeparture})',
|
||||||
date: ticketDate,
|
date: ticketDate,
|
||||||
arrivalCity: '${flight.cityArrival} (${flight.codeArrival})',
|
arrivalCity: '${flight.cityArrival} (${flight.codeArrival})',
|
||||||
|
|
24
pubspec.lock
24
pubspec.lock
|
@ -25,6 +25,22 @@ packages:
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.11.0"
|
version: "2.11.0"
|
||||||
|
barcode:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: barcode
|
||||||
|
sha256: "7b6729c37e3b7f34233e2318d866e8c48ddb46c1f7ad01ff7bb2a8de1da2b9f4"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.2.9"
|
||||||
|
barcode_widget:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: barcode_widget
|
||||||
|
sha256: "6f2c5b08659b1a5f4d88d183e6007133ea2f96e50e7b8bb628f03266c3931427"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.0.4"
|
||||||
boolean_selector:
|
boolean_selector:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -424,6 +440,14 @@ packages:
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.1.8"
|
version: "2.1.8"
|
||||||
|
qr:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: qr
|
||||||
|
sha256: "5a1d2586170e172b8a8c8470bbbffd5eb0cd38a66c0d77155ea138d3af3a4445"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "3.0.2"
|
||||||
shared_preferences:
|
shared_preferences:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
|
|
|
@ -52,6 +52,7 @@ dependencies:
|
||||||
dropdown_button2: ^2.3.9
|
dropdown_button2: ^2.3.9
|
||||||
google_fonts: ^6.2.1
|
google_fonts: ^6.2.1
|
||||||
dotted_dashed_line: ^0.0.3
|
dotted_dashed_line: ^0.0.3
|
||||||
|
barcode_widget: ^2.0.4
|
||||||
# pin_code_fields: ^8.0.1
|
# pin_code_fields: ^8.0.1
|
||||||
# dio: ^5.8.0+1
|
# dio: ^5.8.0+1
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue