To optimize the performance of a Flutter App it's important to only rebuild Widgets when it's actually needed to rebuild them. Between using const Widgets, the TransitionBuilder pattern, Keys and overwritten the == operator there seem to be different approaches to reduce Widget rebuilds, but I have no good idea of how the interact.
The official documentation suggests to do as little work as possible in build methods. How does that compare to work done in the constructor of the Widget? Does the constructor get called as often as the build function, more then it or less then it? If I have a Stateful Widget can I improve performance by caching some data in the state instead of in the constructor or build method?
On Reddit there's a discussion about using functions vs. Stateless Widgets where some people argue that Stateless Widgets cause less rebuilds and others that there's no difference. I would like to understand Flutter's Widget Lifecycle well enough to understand whether in a particular case there's a difference between the two or there isn't.
I'm looking for an explanations of how those different mechanisms interact to make good decisions about how to reduce unnecessary Widget builds in my app.