Building performant Flutter widgets

How do you design a Flutter app to most efficiently
render your scenes? In particular, how do you ensure
that the painting code generated by the
framework is as efficient as possible?
Some rendering and layout operations are known
to be slow, but can’t always be avoided.
They should be used thoughtfully,
following the guidance below.

Minimize expensive operations

Some operations are more expensive than others,
meaning that they consume more resources.
Obviously, you want to only use these operations
when necessary. How you design and implement your
app’s UI can have a big impact on how efficiently it runs.

Control build() cost

Here are some things to keep in mind when designing your UI:

Avoid repetitive and costly work in build() methods
since build() can be invoked frequently when
ancestor widgets rebuild.