Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在我的颤振应用程序中,用户选择一个时间,我需要简单地添加一些小时和分钟来显示结果。这很容易吗?不幸的是,似乎没有像 TimeOfDay.add() 这样的函数。
有任何想法吗?
您可以为此使用日期时间:您可以根据需要添加分钟或小时。
TimeOfDay.fromDateTime(DateTime.now().add(Duration(hours: 2))); // result is 2hrs ahead of current time