EditableTextTapUpOutsideIntent class

An Intent that represents a tap outside the field.

Invoked when the user taps up outside the focused EditableText if EditableText.onTapUpOutside is null.

Override this Intent to modify the default behavior, which is to unfocus on a touch event on web and do nothing on other platforms.

A common requirement is to unfocus text fields when the user taps outside of it. For UX reasons, it's often desirable to only unfocus when the user taps outside of the text field, but not when they scroll.

To achieve this, you can override the default behavior of EditableTextTapOutsideIntent and EditableTextTapUpOutsideIntent to check the difference in distance between the pointer down and pointer up events before potentially unfocusing.

link

To create a local project with this code sample, run:
flutter create --sample=widgets.EditableTextTapUpOutsideIntent.1 mysample

See also:

Inheritance

Constructors

EditableTextTapUpOutsideIntent.new({required FocusNode focusNode, required PointerUpEvent pointerUpEvent})
Creates an EditableTextTapUpOutsideIntent.
const

Properties

focusNode FocusNode
The FocusNode that this Intent's action should be performed on.
final
hashCode int
The hash code for this object.
no setterinherited
pointerUpEvent PointerUpEvent
The PointerUpEvent that initiated this Intent.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringShort() String
A brief description of this object, usually just the runtimeType and the hashCode.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited