toFloatArrayPointer method
Creates a float 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<Float> toFloatArrayPointer({required Allocator allocator}) {
if (isEmpty) {
return nullptr;
}
final Pointer<Float> ptr = allocator(sizeOf<Float>() * length);
for (int i = 0; i < length; i++) {
ptr[i] = this[i];
}
return ptr;
}