childByDocumentType method
Returns a sub-document given its document type name. Returns null if not found.
Implementation
GenericDocument? childByDocumentType(String name) {
return children.firstWhereOrNull((element) => element.type.name == name);
}