addClass method

  1. @override
void addClass(
  1. String? className
)
override

Adds a className to this node classes.

Implementation

@override
void addClass(String? className) {
  if (isEmptyObject(className)) return;
  className = className!.trim();
  if (className.isEmpty) return;

  if (node is Element) {
    var element = nodeAsElement!;
    element.classes.add(className);
  }
}