toList<T> static method

List<T> toList<T>(
  1. dynamic d,
  2. List<T> def
)

Converts a dynamic value to a non-nullable list.

d - The dynamic value to be converted. def - The default list value if conversion fails. Returns a list.

Implementation

static List<T> toList<T>(dynamic d, List<T> def) {
  return toListN(d) ?? def;
}