title: The argument type 'Future<Uint8List>' can't be assigned to the parameter type 'List<int>'
body: <p>Getting this error while trying to save pdf file which I am creating :</p>
  <pre><code>import 'dart:io';
  
  import 'package:flutter/material.dart';
  import 'package:intl/intl.dart';
  import 'package:path_provider/path_provider.dart';
  import 'package:pdf/pdf.dart';
  import 'package:pdf/widgets.dart' as pw;
  
  class PrintBarcodeScreen extends StatefulWidget {
    @override
    _PrintBarcodeScreenState createState() =&gt; _PrintBarcodeScreenState();
  }
  
  class _PrintBarcodeScreenState extends State&lt;PrintBarcodeScreen&gt; {
    var dt = DateTime.now();
    final pdf = pw.Document();
  
    generatePdf() {
      pdf.addPage(
        pw.MultiPage(
            pageFormat: PdfPageFormat.a4,
            margin: pw.EdgeInsets.all(16),
            build: (pw.Context context) {
              return &lt;pw.Widget&gt;[
                pw.Header(
                  level: 0,
                  child: pw.Row(
                    mainAxisAlignment: pw.MainAxisAlignment.spaceBetween,
                    children: [
                      pw.Text(
                        DateFormat.yMMMEd().format(dt),
                        textScaleFactor: 2,
                        // style: getTheme.textTheme.headline6,
                      ),
                      pw.Text(
                        DateFormat.jms().format(dt),
                        // style: getTheme.textTheme.headline6,
                      ),
                    ],
                  ),
                ),
                pw.BarcodeWidget(
                  barcode: pw.Barcode.gs128(),
                  color: PdfColor.fromHex(&quot;#000000&quot;),
                  data: '123456789123',
                  // width: screenSize.width * 0.8,
                  height: 90,
                ),
                pw.Table.fromTextArray(context: context, data: &lt;List&lt;String&gt;&gt;[
                  &lt;String&gt;['Year', 'Ipsum', 'Lorem'],
                  &lt;String&gt;['SN0', 'GFG1'],
                  &lt;String&gt;['SN1', 'GFG2'],
                ]),
              ];
            }),
      );
    }
  
    Future savePdf() async {
      Directory documentDirectory = await getApplicationDocumentsDirectory();
      String documentPath = documentDirectory.path;
      File receiptFile = File(&quot;$documentPath/receipt.pdf&quot;);
      receiptFile.writeAsBytesSync(pdf.save()); // this line is showing error pdf.save() is underlined red
    }
  
    @override
    Widget build(BuildContext context) {
      .........
  }
  
  </code></pre>
  <p>Screenshot: <a href="https://i.stack.imgur.com/zIoFm.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/zIoFm.jpg" alt="screenshot" /></a></p>
  <p>Couldn't find much about it anywhere. Not much experienced yet with flutter to understand the depth of this error. Little I do understand that this is data type mismatch situation. I saw writeAsBytesSync has List bytes parameter, could figure out how can I change my pdf data to int.</p>