It's because you're no longer using const
constructors. Flutter has an optimization where it will short-circuit rebuilding subtrees if a widget is identical (not equal) between rebuilds. You can see the same thing happens if you just remove const
without adding keys: the new Widget instances are not identical, so Flutter uses the keys to link the existing State instances with the new Widget instances, calls didUpdateWidget
on each State, then rebuilds the tree.