错了。
final anHourAgo = (new DateTime.now()) - Duration(minutes: Duration.minutesPerHour);
答案 0 :(得分:1)
这应该有效:
Text(TimeOfDay.fromDateTime(DateTime.now().subtract(Duration(hours: 1))).format(context)),
答案 1 :(得分:1)
已解决。
final anHourAgo = (new DateTime.now()).subtract(new Duration(minutes: Duration.minutesPerHour));