updateEditingValueWithDeltas snippet docs fix (#99570)

Just a docs change for a broken tool snippet.
This commit is contained in:
Justin McCandless 2022-03-09 10:36:09 -08:00 committed by GitHub
parent cff36b946e
commit 035eeb532e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1195,16 +1195,23 @@ abstract class DeltaTextInputClient extends TextInputClient {
/// to the client's editing state. A change is any mutation to the raw text
/// value, or any updates to the selection and/or composing region.
///
/// Here is an example of what implementation of this method could look like:
/// {@tool snippet}
/// This example shows what an implementation of this method could look like.
///
/// ```dart
/// TextEditingValue? _localValue;
/// @override
/// void updateEditingValueWithDeltas(List<TextEditingDelta> textEditingDeltas) {
/// TextEditingValue newValue = _previousValue;
/// if (_localValue == null) {
/// return;
/// }
/// TextEditingValue newValue = _localValue!;
/// for (final TextEditingDelta delta in textEditingDeltas) {
/// newValue = delta.apply(newValue);
/// }
/// _localValue = newValue;
/// }
/// ```
/// {@end-tool}
void updateEditingValueWithDeltas(List<TextEditingDelta> textEditingDeltas);
}