shareInvoice method

Future<void> shareInvoice(
  1. BuildContext context,
  2. Invoice invoice,
  3. String filename
)

Implementation

Future<void> shareInvoice(BuildContext context, Invoice invoice, String filename) async {
  try {
    Uint8List bytes = await buildInvoice(context, invoice, PdfPageFormat.letter);
    await Printing.sharePdf(bytes: bytes, filename: '$filename.pdf');
  } catch(err) {
    throw 'shareInvoice: ${err.toString()}';
  }
}