title: How to convert image to uint8list in flutter without using async?
body: <p>PdfImage requires <strong>Uint8List</strong> as param but I have <strong>ImageProvider</strong>. So how can we convert image to uint8list in flutter?</p>
  
  <pre><code>var imageProvider = AssetImage('assets/test.jpg');
  
  final image = PdfImage(
    pdf.document,
    image:???, /// Uint8List required
    width: img.width,
    height: img.height,
  );
  </code></pre>
  
  <p><strong>Using FutureBuilder:</strong>
  <a href="https://i.stack.imgur.com/S6kYC.png" rel="noreferrer"><img src="https://i.stack.imgur.com/S6kYC.png" alt="enter image description here"></a></p>