如何解决ChangeNotifier 被错误卡住:resetRtgSchedHandle failed enable:0
我目前正在 Flutter 中开发一个应用程序。我正在使用一个从 ChangeNotifier 扩展的类。此类通过应用程序更新一些 UI 组件,具体取决于其他小部件的更改。这非常有效,直到它第二次通知它。
应用程序卡住并且在一段时间内不再可用。一分钟后,调试器将失去与设备的连接,应用会遇到内存问题。
D/RtgSched(12040): resetRtgSchedHandle failed enable:0
V/AudioManager(12040): querySoundEffectsEnabled...
W/HiTouch_PressGestureDetector(12040): Touch pointer move a lot. The moving distance of X is:42.0,limit is:51The moving distance of Y is:69.0,limit is:51
W/HiTouch_PressGestureDetector(12040): Touch pointer move a lot. The moving distance of X is:56.0,limit is:51The moving distance of Y is:6.0,limit is:51
W/HiTouch_PressGestureDetector(12040): Touch pointer move a lot. The moving distance of X is:63.0,limit is:51The moving distance of Y is:12.0,limit is:51
D/RtgSched(12040): resetRtgSchedHandle failed enable:0
W/InputMethodManager(12040): startInputReason = 8
W/IInputConnectionWrapper(12040): getExtractedText on inactive InputConnection
W/IInputConnectionWrapper(12040): getTextBeforeCursor on inactive InputConnection
E/RtgSchedManager(12040): endActivityTransaction: margin state not match
E/RtgSchedManager(12040): endActivityTransaction: margin state not match
E/RtgSchedManager(12040): endActivityTransaction: margin state not match
D/ZrHung.AppEyeUiProbe(12040): not watching,wait.
Lost connection to device.
我在这里注意到的是,自从应用程序上架以来,打印的第一条消息是 resetRtgSchedHandle failed enable:0
,看起来它遇到了计划错误。在互联网上我没有发现任何关于这个问题的信息。
class UIUpdater with ChangeNotifier {
UIUpdateEvent? _currentEvent; // Just an enum class
Map<String,dynamic>? data;
// Singleton concept
UIUpdater._privateConstructor();
static final UIUpdater _instance = UIUpdater._privateConstructor();
static UIUpdater get instance => _instance;
/// Sends an update to the other views
void sendUpdate(UIUpdateEvent updateEvent) {
this._currentEvent = updateEvent;
this.data = null;
notifyListeners();
}
// .....
}
然后我发送一个事件
UIUpdater.instance.sendUpdate(UIUpdateEvent.REFRESH);
然后由侦听器获取:
UIUpdater.instance.addListener(() {
if (UIUpdater.instance.getCurrentEvent() == UIUpdateEvent.REFRESH) {
// Do something...
}
});
有没有人遇到过类似的问题,或者我做错了什么?
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。