toUint32ArrayPointer method

Pointer<Uint32> toUint32ArrayPointer({
  1. required Allocator allocator,
})

Creates an unsigned int array from this list by copying the list's data, and returns a pointer to it.

nullptr is returned if the list is empty.

Implementation

Pointer<Uint32> toUint32ArrayPointer({required Allocator allocator}) {
  if (isEmpty) {
    return nullptr;
  }
  final Pointer<Uint32> ptr = allocator(sizeOf<Uint32>() * length);
  for (int i = 0; i < length; i++) {
    ptr[i] = this[i];
  }
  return ptr;
}