value property
The current value stored in this notifier.
When the value is replaced with something that is not equal to the old value as evaluated by the equality operator ==, this class notifies its listeners.
Implementation
@override
T get value => _value;
Implementation
set value(TextEditingValue newValue) {
newValue = newValue.copyWith( // 修正由于默认值导致的Bug
composing: TextRange(
start: newValue.composing.start < 0 ? 0: newValue.composing.start,
end: newValue.composing.end < 0 ? 0: newValue.composing.end
),
selection: newValue.selection.copyWith(
baseOffset: newValue.selection.baseOffset < 0 ? 0: newValue.selection.baseOffset,
extentOffset: newValue.selection.extentOffset < 0 ? 0: newValue.selection.extentOffset
)
);
try {
super.value = newValue;
} catch (e,stack) {
print(e);
print(stack);
}
}