toPointer static method

Pointer<Uint8> toPointer(
  1. Uint8List bytes
)

Implementation

static Pointer<Uint8> toPointer(Uint8List bytes) {
  final ptr = calloc<Uint8>(bytes.length);
  final byteList = ptr.asTypedList(bytes.length);
  byteList.setAll(0, bytes);
  return ptr.cast();
}