add print qr code page

This commit is contained in:
tzw
2024-02-26 17:26:25 +06:30
parent a3dd9f35fb
commit c06da8a60c
9 changed files with 112 additions and 23 deletions

View File

@@ -0,0 +1,64 @@
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: 'This is a simple QR code',
version: QrVersions.auto,
size: 100,
gapless: true,
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(carton.cartonNumber ?? "",
style: TextStyle(fontSize: 18,fontFamily: "Roboto")),
Text(carton.userName!, 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);
},
),
)
],
));
}
}