performAction method

  1. @override
void performAction(
  1. 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 (!_isMultiline) {
        _finalizeEditing(action, shouldUnfocus: true);
      }
    case TextInputAction.done:
    case TextInputAction.go:
    case TextInputAction.next:
    case TextInputAction.previous:
    case TextInputAction.search:
    case TextInputAction.send:
      _finalizeEditing(action, shouldUnfocus: true);
    case TextInputAction.continueAction:
    case TextInputAction.emergencyCall:
    case TextInputAction.join:
    case TextInputAction.none:
    case TextInputAction.route:
    case TextInputAction.unspecified:
      // Finalize editing, but don't give up focus because this keyboard
      // action does not imply the user is done inputting information.
      _finalizeEditing(action, shouldUnfocus: false);
  }
}