gpt4 book ai didi

dart - 错误未定义类 TimeOfDay。尝试使用 flutter 时间时

转载 作者:IT王子 更新时间:2023-10-29 06:51:40 26 4
gpt4 key购买 nike

enter image description here当我使用 TimeOfDay 时,我得到了 error undefined class TimeOfDay。它以前工作过。我正在努力争取时间,

TimeOfDay theTime = new TimeOfDay.now();

我不明白为什么会出现错误。

最佳答案

也许你犯了一个错误,修改了 time.dart 中的 TimeOfDay 类,有时会发生这种情况。你能检查类 theTimeTimeOfDay 的源代码吗?因为它不应该存在。

time.dart 类应该以这样的开头

@immutable
class TimeOfDay {

我 99% 确定你是这样命名的:

@immutable
class theTimeTimeOfDay {

关于dart - 错误未定义类 TimeOfDay。尝试使用 flutter 时间时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51886446/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com