FocusNode constructor
- String? debugLabel,
- @Deprecated('Use onKeyEvent instead. ' 'This feature was deprecated after v3.18.0-2.0.pre.') FocusOnKeyCallback? onKey,
- FocusOnKeyEventCallback? onKeyEvent,
- bool skipTraversal = false,
- bool canRequestFocus = true,
- bool descendantsAreFocusable = true,
- bool descendantsAreTraversable = true,
Creates a focus node.
The debugLabel
is ignored on release builds.
To receive key events that focuses on this node, pass a listener to
onKeyEvent
.
Implementation
FocusNode({
String? debugLabel,
@Deprecated(
'Use onKeyEvent instead. '
'This feature was deprecated after v3.18.0-2.0.pre.',
)
this.onKey,
this.onKeyEvent,
bool skipTraversal = false,
bool canRequestFocus = true,
bool descendantsAreFocusable = true,
bool descendantsAreTraversable = true,
}) : _skipTraversal = skipTraversal,
_canRequestFocus = canRequestFocus,
_descendantsAreFocusable = descendantsAreFocusable,
_descendantsAreTraversable = descendantsAreTraversable {
// Set it via the setter so that it does nothing on release builds.
this.debugLabel = debugLabel;
if (kFlutterMemoryAllocationsEnabled) {
ChangeNotifier.maybeDispatchObjectCreation(this);
}
}