isActionableControl function

bool isActionableControl(
  1. Element element
)

Interactive controls suitable as the primary target of a text locator. Excludes bare Semantics wrappers that may span multiple controls.

Implementation

bool isActionableControl(Element element) {
  final widget = element.widget;
  return widget is ElevatedButton ||
      widget is TextButton ||
      widget is OutlinedButton ||
      widget is FilledButton ||
      widget is GestureDetector ||
      widget is InkWell ||
      widget is InkResponse ||
      widget is TextField ||
      widget is CupertinoTextField ||
      widget is EditableText ||
      widget is Checkbox ||
      widget is Switch ||
      widget is CupertinoSwitch ||
      widget is Slider ||
      _isIconButtonWidget(widget) ||
      _isDropdownWidget(widget);
}