add print qr code page
This commit is contained in:
64
lib/pages/carton/print_qr_code_page.dart
Normal file
64
lib/pages/carton/print_qr_code_page.dart
Normal 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);
|
||||
},
|
||||
),
|
||||
)
|
||||
],
|
||||
));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user