toObjectForSourceLocation method

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

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.


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