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
@override
set value(TextEditingValue newValue) {
String oldText = value.text;
String newText = newValue.text;
int position = newValue.selection.end;
final diff = getDiff(oldText, newText, position);
if (diff.inserted.length == 1) {
TextWithPosition? textWithPosition = manageDeadKey(
oldText, position,
diff.inserted
);
if (textWithPosition != null) {
newValue = super.value.copyWith(
text: textWithPosition.text,
selection: value.selection.copyWith(
baseOffset: textWithPosition.position,
extentOffset: textWithPosition.position,
),
);
}
}
super.value = newValue;
}