Focus class

A widget that attaches a FocusNode to the widget tree and forwards key events.

Wrap a child widget with Focus to make it part of the focus traversal and receive keyboard events via onKeyEvent.

Inheritance

Constructors

Focus({Key? key, FocusNode? focusNode, dynamic onKeyEvent(KeyEvent)?, required Widget child})
Creates a Focus widget with an optional focusNode and onKeyEvent.
const

Properties

child Widget
The child widget that receives focus.
final
focusNode FocusNode?
An optional external focus node.
final
hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another in the tree.
finalinherited
onKeyEvent → dynamic Function(KeyEvent)?
A callback invoked when a key event reaches this node.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

createElement() StatefulElement
Creates the Element for this widget.
inherited
createState() State<Focus>
Creates the mutable state for this widget.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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