listToArray static method

List listToArray(
  1. dynamic value
)

Converts value into array object with empty array as default. Strings with comma-delimited values are split into array of strings.

  • value the list to convert. Returns array object or empty array when value is null

See toArray

Implementation

static List listToArray(value) {
  if (value == null) return [];
  if (value is String) value = value.split(',');
  return ArrayConverter.toArray(value);
}