dart 基础知识快速入门

..  表示对同一个对象进行多次操作时,名称为cascade notation。

animation = Tween(begin: 0, end: 300).animate(controller)
  ..addListener(() {
    // ···
  });

这段代码相当于:

animation = Tween(begin: 0, end: 300).animate(controller);
animation.addListener(() {

你可能感兴趣的:(dart)