enabled property

bool get enabled

Whether it can be pressed: a command with onPressed, or a submenu with children.

Implementation

bool get enabled {
  return onPressed != null || (children?.isNotEmpty ?? false);
}