previousFocus method

  1. @mustBeOverridden
bool previousFocus(
  1. String nodeId
)

Moves the focus to the previous focusable node in the traversal order relative to the node identified by nodeId.

Returns true if the focus was successfully moved to a previous node, or false if there was no previous node to move to (for example, if nodeId is the first node in the order).

Implementations should resolve the FocusNode associated with nodeId and call its underlying previousFocus() method, or use a platform-appropriate mechanism to move focus backward in the order. This is commonly used for reverse keyboard navigation (e.g., Shift+Tab) or for programmatic focus traversal in complex UIs.

Throws MissingCapabilityMethodImplementation if not overridden.

See also:

Implementation

@mustBeOverridden
bool previousFocus(String nodeId) =>
    throw const MissingCapabilityMethodImplementation(
      "previousFocus",
      "FocusCapabilityDelegate",
    );