readInvokableLocatorId function

String? readInvokableLocatorId(
  1. Element element
)

YAML id: from an Invokable mixed onto element's widget, if any.

Implementation

String? readInvokableLocatorId(Element element) {
  final widget = element.widget;
  if (widget is! Invokable) return null;
  final id = (widget as Invokable).id;
  if (id == null) return null;
  final compact = compactWidgetLocatorId(id);
  return compact.isEmpty ? null : compact;
}