add pdf generator
This commit is contained in:
@@ -1,9 +1,12 @@
|
||||
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';
|
||||
|
||||
class CartonListRow extends StatelessWidget {
|
||||
@@ -64,7 +67,11 @@ class CartonListRow extends StatelessWidget {
|
||||
),
|
||||
const SizedBox(width: 15),
|
||||
IconButton(
|
||||
onPressed: () {}, icon: Icon(AntDesign.qrcode,color: Colors.black))
|
||||
onPressed: () {
|
||||
_pdf(box, context);
|
||||
},
|
||||
icon:
|
||||
Icon(AntDesign.qrcode, color: Colors.black))
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -100,4 +107,11 @@ 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