isEnabled property Null safety

bool? isEnabled

Whether the owning RenderObject is currently enabled.

A disabled object does not respond to user interactions. Only objects that usually respond to user interactions, but which currently do not (like a disabled button) should be marked as disabled.

The setter should not be called for objects (like static text) that never respond to user interactions.

The getter will return null if the owning RenderObject doesn't support the concept of being enabled/disabled.

This property does not control whether semantics are enabled. If you wish to disable semantics for a particular widget, you should use an ExcludeSemantics widget.

Implementation

bool? get isEnabled => _hasFlag(SemanticsFlag.hasEnabledState) ? _hasFlag(SemanticsFlag.isEnabled) : null;
void isEnabled=(bool? value)

Implementation

set isEnabled(bool? value) {
  _setFlag(SemanticsFlag.hasEnabledState, true);
  _setFlag(SemanticsFlag.isEnabled, value!);
}