performAction method

  1. @override
  2. @mustCallSuper
void performAction(
  1. TextInputAction action
)
override

Requests that this client perform the given action.

Implementation

@override
@mustCallSuper
void performAction(TextInputAction action) {
  _onPerformActionPressed?.call(action);

  // Keep track that we have performed a text input action on this frame so we can ignore auto-corrections
  // reported after we handled the text input action.
  //
  // We don't ignore TextInputAction.newline because the insertion of the new line happens after the action
  // is reported, and we need to handle the new line insertion to let users replace the selected content
  // with a new line.
  //
  // See https://github.com/superlistapp/super_editor/issues/2004 for more information.
  _hasPerformedNonNewLineTextInputActionThisFrame = action != TextInputAction.newline;
  WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
    _hasPerformedNonNewLineTextInputActionThisFrame = false;
  });
}