mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
updateEditingValueWithDeltas snippet docs fix (#99570)
Just a docs change for a broken tool snippet.
This commit is contained in:
parent
cff36b946e
commit
035eeb532e
@ -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);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user