findsOrNull<T extends Object?> method

List<T>? findsOrNull<T extends Object?>({
  1. Object? key,
  2. List<T>? defaultValue,
  3. ObjectBuilder<T>? builder,
})

Implementation

List<T>? findsOrNull<T extends Object?>({
  Object? key,
  List<T>? defaultValue,
  ObjectBuilder<T>? builder,
}) {
  final root = this;
  final data = key == null
      ? root
      : root is Map
          ? root[key]
          : null;
  final iterable = _vs(data, builder);
  if (iterable == null) return defaultValue;
  return List.from(iterable);
}