FocusManager class
Manages focus across the widget tree, analogous to Flutter's FocusManager.
Handles keyboard events for focus traversal (Tab/Shift+Tab) and dispatches key events to the currently focused node.
- Inheritance
-
- Object
- NavigatorObserver
- FocusManager
Properties
- currentFocus → FocusNode?
-
The currently focused node, or null if nothing is focused.
no setter
- currentScope → FocusScope?
-
The current focus scope, or null if not initialized.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
didPop(
Route route, Route? previousRoute) → void -
Called when a route has been popped off the navigator.
override
-
didPush(
Route route, Route? previousRoute) → void -
Called when a route has been pushed onto the navigator.
override
-
didReplace(
{Route? newRoute, Route? oldRoute}) → void -
Called when a route has been replaced by another route.
override
-
didStartUserGesture(
Route route, Route? previousRoute) → void -
Called when the user starts a gesture to navigate.
inherited
-
didStopUserGesture(
) → void -
Called when the user stops a navigation gesture.
inherited
-
dispose(
) → void - Disposes the focus manager, canceling subscriptions and cleaning up scopes.
-
initialize(
) → void - Initializes the focus manager and starts listening to keyboard events.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
popDialogScope(
) → void - Pops the current focus scope, restoring the previous one.
-
pushDialogScope(
) → void - Pushes a new focus scope, typically for a dialog.
-
registerNode(
FocusNode node) → void - Registers a FocusNode with the current focus scope.
-
requestFocus(
FocusNode node) → void -
Requests focus for the given
node. -
setTestKeyEvents(
Stream< KeyEvent> stream) → void - Sets a test key event stream for testing purposes.
-
toString(
) → String -
A string representation of this object.
inherited
-
unregisterNode(
FocusNode node) → void - Unregisters a FocusNode from the current focus scope.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- instance → FocusManager
-
The singleton instance of FocusManager.
no setter