debugPaintFocusBoxes top-level property
getter/setter pair
Causes each Focus widget to paint a box around its bounds.
Different colors indicate different focus states:
- Green: the node has primary focus.
- Blue: the node is in the focus chain but does not have primary focus (i.e., it is an ancestor of the primary focus).
- Cyan: the node is focusable and participates in focus traversal.
- Yellow: the node skips focus traversal (FocusNode.skipTraversal is true) but can still receive focus directly.
- Red: the node cannot receive focus (FocusNode.canRequestFocus is false).
Enabling this causes each Focus widget to wrap its child with a widget, which can cause state loss if the child is a stateful widget that isn't keyed.
This has no effect in release builds.
See also:
- FocusNode, which manages focus for a widget subtree.
- debugFocusChanges, which logs to the console when focus changes occur.
Implementation
bool debugPaintFocusBoxes = false;