Leaf constructor
Leaf(
- Object data
Creates a new Leaf with specified data
.
Implementation
factory Leaf(Object data) {
if (data is Embeddable) {
return Embed(data);
}
final text = data as String;
assert(text.isNotEmpty);
return QuillText(text);
}