parseBoolLiteral function Null safety

bool parseBoolLiteral(
  1. XmlElement element,
  2. String tagName
)

Implementation

bool parseBoolLiteral(XmlElement element, String tagName) {
  var v = element.findElements(tagName).firstOrNull?.text.toLowerCase().trim();
  if (v == null) return false;
  return ['yes', 'true'].contains(v);
}