listFromJson static method

List<DocumentPatch> listFromJson(
  1. List? json
)

Implementation

static List<DocumentPatch> listFromJson(List<dynamic>? json) {
  if (json == null) {
    return <DocumentPatch>[];
  }

  return json.fold(<DocumentPatch>[],
      (List<DocumentPatch> previousValue, element) {
    final DocumentPatch? object = DocumentPatch.fromJson(element);
    if (object is DocumentPatch) {
      previousValue.add(object);
    }

    return previousValue;
  });
}