performAction method

  1. @override
void performAction (TextInputAction action)
override

Requests that this client perform the given action.

Implementation

@override
void performAction(TextInputAction action) {
  switch (action) {
    case TextInputAction.newline:
      // If this is a multiline EditableText, do nothing for a "newline"
      // action; The newline is already inserted. Otherwise, finalize
      // editing.
      if (widget.maxLines == 1)
        _finalizeEditing(true);
      break;
    case TextInputAction.done:
    case TextInputAction.go:
    case TextInputAction.send:
    case TextInputAction.search:
      _finalizeEditing(true);
      break;
    default:
      // Finalize editing, but don't give up focus because this keyboard
      //  action does not imply the user is done inputting information.
      _finalizeEditing(false);
      break;
  }
}