add print qr code page
This commit is contained in:
@@ -1,13 +1,11 @@
|
||||
import 'package:fcs/domain/entities/carton.dart';
|
||||
import 'package:fcs/helpers/theme.dart';
|
||||
import 'package:fcs/pages/carton/model/carton_model.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_vector_icons/flutter_vector_icons.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import '../../../helpers/pdf.dart';
|
||||
import '../carton_info.dart';
|
||||
import '../print_qr_code_page.dart';
|
||||
|
||||
class CartonListRow extends StatelessWidget {
|
||||
final Carton box;
|
||||
@@ -68,7 +66,12 @@ class CartonListRow extends StatelessWidget {
|
||||
const SizedBox(width: 15),
|
||||
IconButton(
|
||||
onPressed: () {
|
||||
_pdf(box, context);
|
||||
Navigator.push(
|
||||
context,
|
||||
CupertinoPageRoute(
|
||||
builder: (context) =>
|
||||
PrintQrCodePage(carton: box)),
|
||||
);
|
||||
},
|
||||
icon:
|
||||
Icon(AntDesign.qrcode, color: Colors.black))
|
||||
@@ -107,11 +110,4 @@ class CartonListRow extends StatelessWidget {
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
_pdf(Carton carton, BuildContext context) async {
|
||||
Carton? c = await context.read<CartonModel>().getCarton(carton.id!);
|
||||
if (c == null) return;
|
||||
|
||||
generateCartonPdf(c);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user