applyValue method
Apply (or clear when value is null) a value-attribute over the selection.
Implementation
void applyValue(UInlineAttr attr, Object? value) {
final TextSelection sel = selection;
if (!sel.isValid) return;
if (sel.isCollapsed) {
if (value == null) {
pending.remove(attr);
} else {
pending[attr] = value;
}
notifyListeners();
return;
}
removeAttr(attr, sel.start, sel.end);
if (value != null) spans.add(UStyleSpan(start: sel.start, end: sel.end, attr: attr, value: value));
normalize();
notifyListeners();
}