loadTags static method

List<Category>? loadTags(
  1. XmlElement node, {
  2. String? defaultScheme,
})

Helper function to create a List of categories from an string separated by commas

Implementation

static List<Category>? loadTags(XmlElement node, {String? defaultScheme}) {
  final tags = node.innerText.split(',').where((e) => e.isNotEmpty);
  if (tags.isEmpty) return null;
  return List.generate(
    tags.length,
    (pos) => Category(label: tags.elementAt(pos).trim(), scheme: defaultScheme),
  );
}