doubleListToArray function

Pointer<Double> doubleListToArray(
  1. List<double> list
)

Convert Dart double list to C double array.

Implementation

Pointer<Double> doubleListToArray(List<double> list) {
  final length = list.length;
  final pointer = calloc<Double>(length + 1); // +1 if null-terminated.
  for (int index = 0; index < length; index++) {
    pointer[index] = list[index];
  }
  return pointer;
}