How to deal with unwanted widget build?

The build method is designed in such a way that it should be pure/without side effects. This is because many external factors can trigger a new widget build, such as: Route pop/push Screen resize, usually due to keyboard appearance or orientation change The parent widget recreated its child An InheritedWidget the widget depends on (Class.of(context) … Read more