toObjectForSourceLocation method

  1. @protected
Object toObjectForSourceLocation (String id, [ String groupName ])
@protected

Returns the object to introspect to determine the source location of an object's class.

The Dart object for the id is returned for all cases but Element objects where the Widget configuring the Element is returned instead as the class of the Widget is more relevant than the class of the Element.

The groupName parameter is not required by is added to regularize the API surface of methods called from the Flutter IntelliJ Plugin.

Implementation

@protected
Object toObjectForSourceLocation(String id, [ String groupName ]) {
  final Object object = toObject(id);
  if (object is Element) {
    return object.widget;
  }
  return object;
}