findAllDirectElementsOrNull function

List<XmlElement>? findAllDirectElementsOrNull(
  1. XmlElement element,
  2. String name, {
  3. String? namespace,
})

Implementation

List<XmlElement>? findAllDirectElementsOrNull(XmlElement element, String name, {String? namespace}) {
  try {
    return element.findElements(name, namespace: namespace).toList();
  } on StateError {
    return null;
  }
}