This results in the instances being different, and so they are not deduplicated by the set.
We use this injected information to make the error messages clearer when
a widget is involved in an exception, by reporting where the relevant widget was created.
Unfortunately, it has the visible side-effect of making otherwise-identical constants be
different at compile time.

To disable this behavior, pass --no-track-widget-creation to the flutter run command.
With that flag set, the code above prints “1” in debug and release builds, and error messages
include a message saying that they cannot provide all the information that they would otherwise
be able to provide if widget creation tracking was enabled.

See also:

Our documentation on how the Widget Inspector uses widget creation tracking.

WidgetInspectorService.isWidgetCreationTracked.

The _Location class in widget_inspector.dart.

The kernel transform that implements this feature.

Other resources