That seems to be a documentation error, https://github.com/flutter/flutter/pull/10339. Thanks!
Tween and the
AnimationController are linked in line 55 of
AnimationController is an
Animation<double> and since the
Ts, it can be used to create an
Animation<T> from an
Animation<double>. This is done using the
animate method of
Tween which it inherits from
Animatable and the result is given to the painter…
The animation-driven repainting with
BarChartPainter is set up in this line which contains a call to the constructor of
CustomPainter with the
Animation<Bar> as argument. See the relevant Flutter API documentation here. There is no Dart magic involved, just a call to a superclass constructor.
I’m happy you found the article useful! I wouldn’t implement
lerp using a factory constructor. Three reasons:
newwhenever you use it.