title: Pass Uint8List to Pointer<Void> in dart:ffi
body: <p>I have a C function with the Following signature</p>
  
  <pre><code>bool sendFrame(int width, int height, int channelNumber, void *data, bool clone);
  </code></pre>
  
  <p>data here being a raw image.</p>
  
  <p>My ffi function signature is:</p>
  
  <pre class="lang-dart prettyprint-override"><code>  final int Function(int, int, int, Pointer&lt;Void&gt;, int) rPPGSendFrame = rPPGLib
        .lookup&lt;
            NativeFunction&lt;
                Int32 Function(
                    Int32, Int32, Int32, Pointer&lt;Void&gt;, Int32)&gt;&gt;("sendFrame")
        .asFunction();
  </code></pre>
  
  <p>(the bools have to be converted to ints because the bool type is not supported yet (right?))</p>
  
  <p>I'm trying to call this method from dart with a <code>Uint8List</code> coming from a frame of the camera stream <a href="https://pub.dev/documentation/camera/latest/camera/Plane-class.html" rel="nofollow noreferrer">https://pub.dev/documentation/camera/latest/camera/Plane-class.html</a> but I'm not sure how to convert/allocate my <code>Uint8List</code> to <code>void *</code></p>
  
  <p>Any idea?</p>
  
  <p>Cheers!</p>