debugPaintFocusBoxes top-level property

bool debugPaintFocusBoxes
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:

Implementation

bool debugPaintFocusBoxes = false;