71 lines
2.5 KiB
Dart
71 lines
2.5 KiB
Dart
import 'package:fcs/domain/entities/carton.dart';
|
|
import 'package:fcs/helpers/theme.dart';
|
|
import 'package:fcs/pages/widgets/local_app_bar.dart';
|
|
import 'package:fcs/pages/widgets/local_button.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:qr_flutter/qr_flutter.dart';
|
|
|
|
import '../../helpers/pdf.dart';
|
|
|
|
class PrintQrCodePage extends StatelessWidget {
|
|
final Carton carton;
|
|
const PrintQrCodePage({required this.carton});
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
appBar: LocalAppBar(
|
|
labelKey: "box.print.qr.title",
|
|
backgroundColor: Colors.white,
|
|
labelColor: primaryColor,
|
|
arrowColor: primaryColor,
|
|
actions: []),
|
|
body: ListView(
|
|
padding: EdgeInsets.only(left: 15, right: 15),
|
|
children: [
|
|
const SizedBox(height: 40),
|
|
Row(
|
|
children: [
|
|
QrImageView(
|
|
data: carton.cartonNumber ?? "",
|
|
version: QrVersions.auto,
|
|
size: 100,
|
|
gapless: true),
|
|
Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
Text(carton.cartonNumber ?? "",
|
|
style: TextStyle(fontSize: 18, fontFamily: "Roboto")),
|
|
carton.consigneeName == null || carton.consigneeName == ''
|
|
? const SizedBox()
|
|
: Text(carton.consigneeName!,
|
|
style:
|
|
TextStyle(fontSize: 16, fontFamily: "Roboto")),
|
|
Padding(
|
|
padding: const EdgeInsets.only(top: 3),
|
|
child: Text("${carton.actualWeight} lb",
|
|
style: TextStyle(
|
|
fontSize: 16,
|
|
color: labelColor,
|
|
fontFamily: "Roboto")),
|
|
)
|
|
],
|
|
)
|
|
],
|
|
),
|
|
const SizedBox(height: 30),
|
|
Padding(
|
|
padding: const EdgeInsets.symmetric(horizontal: 40),
|
|
child: LocalButton(
|
|
textKey: "box.print.btn",
|
|
color: primaryColor,
|
|
iconData: Icons.print_outlined,
|
|
callBack: () {
|
|
generateCartonPdf(carton);
|
|
},
|
|
),
|
|
)
|
|
],
|
|
));
|
|
}
|
|
}
|