cdata method Null safety

void cdata(
  1. Object text
)

Adds a XmlCDATA node with the provided text.

For example, to generate a CDATA element with the text Hello World one would write:

builder.cdata('Hello World');

Implementation

void cdata(Object text) {
  _stack.last.children.add(XmlCDATA(text.toString()));
}