newTag static method

Bs4Element newTag(
  1. String? name, {
  2. Map<String, String>? attrs,
  3. String? string,
})

Creates a new Bs4Element.

  • name - tag name
  • attrs - attributes to be added to the tag
  • string - text content

Implementation

static Bs4Element newTag(
  String? name, {
  Map<String, String>? attrs,
  String? string,
}) {
  final newElement = Element.tag(name);
  if (attrs != null) {
    newElement.attributes.addAll(attrs);
  }
  newElement.text = string;
  return newElement.bs4;
}