getNumeric static method

SvgNumeric? getNumeric(
  1. XmlElement xml,
  2. String name,
  3. SvgBrush? brush, {
  4. String? namespace,
  5. double? defaultValue,
})

Implementation

static SvgNumeric? getNumeric(XmlElement xml, String name, SvgBrush? brush,
    {String? namespace, double? defaultValue}) {
  final attr = xml.getAttribute(name, namespace: namespace);

  if (attr == null) {
    return defaultValue == null ? null : SvgNumeric.value(defaultValue, null);
  }

  return SvgNumeric(attr, brush);
}