transformToList method

  1. @override
List<T>? transformToList(
  1. Object? o
)
override

Implementation

@override
List<T>? transformToList(Object? o) {
  if (transformerToList != null) {
    return transformerToList!(o);
  }

  if (o == null) return <T>[];

  if (o is List) {
    if (o.isEmpty) return <T>[];
    return o.map(transformTo).whereType<T>().toList();
  } else {
    return [transformTo(o)].whereType<T>().toList();
  }
}