generateDoc method

Future<void> generateDoc({
  1. String? date = "4/9/2020",
  2. String? info,
  3. String? taxId = "12331",
  4. String? receiverName = "Richie",
  5. String? receiverMail = "info@yegobox.com",
  6. String? receiverPhone,
  7. String email = "info@yegobox.com",
  8. required List<TableRow> rows,
})

Implementation

Future<void> generateDoc({
  String? date = "4/9/2020",
  String? info,
  String? taxId = "12331",
  String? receiverName = "Richie",
  String? receiverMail = "info@yegobox.com",
  String? receiverPhone,
  String email = "info@yegobox.com",
  required List<TableRow> rows,
}) async {
  doc.addPage(
    Page(
      pageFormat: PdfPageFormat.a4,
      build: (Context context) {
        return PwPage(
          date: date,
          info: info,
          taxID: taxId,
          receiverName: receiverName,
          receiverMail: receiverMail,
          receiverPhone: receiverPhone,
          rows: rows,
        );
      },
    ),
  );
  await Printing.sharePdf(
    bytes: await doc.save(),
    filename: 'receipt.pdf',
    subject: "receipt",
    body: "Thank you for visinting us",
    emails: [email],
  );
}