statesController property

MaterialStatesController? statesController
final

Represents the interactive "state" of this widget in terms of a set of WidgetStates, including WidgetState.disabled, WidgetState.hovered, WidgetState.error, and WidgetState.focused.

Classes based on this one can provide their own WidgetStatesController to which they've added listeners. They can also update the controller's WidgetStatesController.value however, this may only be done when it's safe to call State.setState, like in an event handler.

The controller's WidgetStatesController.value represents the set of states that a widget's visual properties, typically WidgetStateProperty values, are resolved against. It is not the intrinsic state of the widget. The widget is responsible for ensuring that the controller's WidgetStatesController.value tracks its intrinsic state. For example one cannot request the keyboard focus for a widget by adding WidgetState.focused to its controller. When the widget gains the or loses the focus it will WidgetStatesController.update its controller's WidgetStatesController.value and notify listeners of the change.

Implementation

final MaterialStatesController? statesController;