convertArray static method

List<num> convertArray(
  1. List<num> array,
  2. String type, [
  3. bool forceClone = false
])

Converts an array to a specific type.

Implementation

static List<num> convertArray(List<num> array, String type, [bool forceClone = false]) {
  if(!forceClone && type == 'List<num>'){
    return array;
  }
  if (type == 'List<num>') {
    // create typed array
    return List<num>.from(array);
  }

  return array.sublist(0);//slice(array, 0); // create Array
}