Flutter Docs说:“要创建新的Duration对象,请使用此类的单个构造函数并提供适当的参数:”
Duration fastestMarathon = new Duration(hours:2, minutes:3, seconds:2);
但是当我这样尝试时,我的IDE会说: “预计需要1个自变量,但找到0个。
Duration(dynamic durationHandler, {int days: 0, int hours: 0, int minutes: 0, int seconds: 0, int milliseconds: 0, int microseconds: 0}) → Duration
durationHandler是什么?