Flutter, didUpdateWidget()

Why do we need didUpdateWidget(), when we can simply use setState()? Are there cases when the former is called even when the latter is not called?

A use case for using didUpdateWidget() is when you are animating between widgets. E.g. using a animationController.

1 Like