readList<E> method

List<E> readList<E>({
  1. String fieldName = '',
})

Reads the dartObject instance and returns an instance of List<T>.

  • If the argument fieldName is not empty, it reads the field of the object instead and throws ErrorOfType with type argument InvalidFieldName if the field does not exist.
  • Throws ErrorOf with type argument Decoder with type argument List with type argument E if a list can not be constructed.

Implementation

List<E> readList<E>({String fieldName = ''}) {
  if (isNotCoreType<List<E>>()) {
    addDecoder<List<E>>(ListDecoder<E>());
  }
  return read<List<E>>(fieldName: fieldName);
}