Group Group Group Group Group Group Group Group Group

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.

https://api.flutter.dev/flutter/animation/AnimationController-class.html

1 Like