AutoKey
A Key
that takes a hashable object and wraps it, forwarding equality and hashValue
tests to the underlying object. A common pattern you’ll see in Amai code is:
struct MyWidget: StatelessWidget, HashableWidget {
var key: Key = NullKey()
init() {
self.key = AutoKey(self)
}
}
Here, the widget’s AutoKey
wraps itself.