debugIsWidgetLocalCreation function Null safety

bool debugIsWidgetLocalCreation(
  1. Widget widget
)

Returns true if a Widget is user created.

This is a faster variant of debugIsLocalCreationLocation that is available in debug and profile builds but only works for Widget.

Implementation

bool debugIsWidgetLocalCreation(Widget widget) {
  final _Location? location = _getObjectCreationLocation(widget);
  return location != null &&
      WidgetInspectorService.instance._isLocalCreationLocation(location.file);
}