lerp method
Returns the value this variable has at the given animation clock value.
The default implementation of this method uses the +
, -
, and *
operators on T
. The begin and end properties must therefore be
non-null by the time this method is called.
In general, however, it is possible for this to return null, especially
when t
=0.0 and begin is null, or t
=1.0 and end is null.
Implementation
@override
String lerp(double t) {
// 在动画过程中 t 的值是从 0 到 1
var cutoff = (end!.length * t).round();
// 返回动画时钟t时刻 对应的文字。
return end!.substring(0, cutoff);
}