What is the bug?
When a Marker has a key set, we use it internally on the Positioned widget. When we build multiple of them to cover across worlds, we duplicate the key, which is forbidden, causing an error.
How can we reproduce it?
Use the example app, add a key to any marker, zoom out until it should be visible multiple times.
Do you have a potential solution?
We should determine whether it is necessary to have the key passthrough here (for example, if the child is stateful). If it is, we should incorporate the world-shift value. The automated test will also need fixing (although from early experiments this was more difficult than it needed to be).
Ideally, we shouldn't build the same child more than once across the world - the ideal situation would be that it only gets built once, and painted multiple times. This is impossible without a custom render object: see #2134.
What is the bug?
When a
Markerhas a key set, we use it internally on thePositionedwidget. When we build multiple of them to cover across worlds, we duplicate the key, which is forbidden, causing an error.How can we reproduce it?
Use the example app, add a key to any marker, zoom out until it should be visible multiple times.
Do you have a potential solution?
We should determine whether it is necessary to have the key passthrough here (for example, if the child is stateful). If it is, we should incorporate the world-shift value. The automated test will also need fixing (although from early experiments this was more difficult than it needed to be).
Ideally, we shouldn't build the same child more than once across the world - the ideal situation would be that it only gets built once, and painted multiple times. This is impossible without a custom render object: see #2134.