gpt4 book ai didi

dart - 实时 flutter

转载 作者:IT王子 更新时间:2023-10-29 06:53:42 31 4
gpt4 key购买 nike

我正在实现实时 flutter 库 https://pub.dartlang.org/packages/true_time

遇到错误

W/DiskCacheClient(26153): Cannot use disk caching strategy for TrueTime.

CacheInterface unavailable
D/TrueTimeRx(26153): ---- resolving ntpHost : ntp.google.com
W/DiskCacheClient(26153): Cannot use disk caching strategy for TrueTime. CacheInterface unavailable
E/MethodChannel#true_time(26153): Failed to handle method call
E/MethodChannel#true_time(26153): java.lang.IllegalStateException: You need to call init() on TrueTime at least once.

我通过上面链接的自述文件中的代码副本收到此错误。

最佳答案

你试过使用这个库吗?它只使用 Dart 代码,而不是平台 channel 。 https://pub.dartlang.org/packages/ntp

你可以获得这样的时间:

DateTime startDate = await NTP.now();

免责声明:我是这个库的开发者。

关于dart - 实时 flutter ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55040073/

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