toList function

List toList(
  1. dynamic value, {
  2. List? defaultValue,
})

Implementation

List toList(value, {List? defaultValue}) {
  if (value == null) return defaultValue ?? [];
  if (value is List) return value;
  return defaultValue ?? [];
}