-
Notifications
You must be signed in to change notification settings - Fork 28.7k
updateEditingValueWithDeltas snippet docs fix #99570
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
/// {@tool snippet} | ||
/// This example shows what an implementation of this method could look like. | ||
/// | ||
/// ```dart |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch! Looks like the test is failing regarding some variables not being defined. I think something like this would make sense, removing _previousValue
, what do you think?
/// TextEditingValue _localValue;
/// @override
/// void updateEditingValueWithDeltas(List<TextEditingDelta> textEditingDeltas) {
/// TextEditingValue newValue = _localValue;
/// for (final TextEditingDelta delta in textEditingDeltas) {
/// newValue = delta.apply(newValue);
/// }
/// _localValue = newValue;
/// }
/// ```
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah that's right. That looks good to me, I'll try it. Thanks!
ac715d1
to
98261b8
Compare
98261b8
to
9290ed0
Compare
The snippet appeared broken on the docs site due to formatting. This PR formats it correctly.