Widgets marked const that should be equal to each other, aren’t

In debug mode, you might find that two const widgets that should to all
appearances be equal (because of Dart’s constant deduplication) are not.

For example, this code should print 1:

It should print 1 (rather than 2) because the two constants are the same and sets
coalesce duplicate values (and indeed the analyzer complains that
“Two elements in a set literal shouldn’t be equal”). As expected, in release
builds, it does print 1. However, in debug builds it prints 2. This is because the
flutter tool injects the source location of Widget constructors into the code at compile
time, so the code is effectively: