Tomek Polański
1 min readMar 29, 2019

--

I agree that it is not just black and white.

When a person has worked enough with Flutter then she has the feeling which approach is better.

For new people starting Flutter, I’ve already seen plenty of cases where performance was suffering — that is why in my opinion it’s better to know what might be impacting the performance.

The other point regarding AnimatedBuilder not providing a value I’ve created a very simple widget that provides this value (of course some of the cases you’ve mentioned, like the Text, won’t benefit from it):

AnimationBuilder(
animation: CurvedAnimation(
parent: _controller,
curve: Interval(0.5, 0.75, curve: Curves.ease),
),
builder: (_, animation, child) {
return Transform(
transform: Matrix4.identity()
..rotateX((1 - animation.value) * (pi / 2)),
child: child,
);
},
child: Text('Flutter'),
)

All I am saying in the end that withAnimatedBuilder we can be more precise what to rebuild and in some cases that will improve the performance.

Lastly, when a widget is directly using the value (like the Text example you’ve mentioned), then the Text widget would be inside the builder so still it’s possible to use AnimatedBuilder in that way.

--

--

Tomek Polański
Tomek Polański

Written by Tomek Polański

Passionate mobile developer. One thing I like more than learning new things: sharing them

Responses (1)