最近通过sentry解决异常的时候发现了一个报错:
════════ Exception caught by widgets library ═══════════════════════════════════════════════════════
The following assertion was thrown while finalizing the widget tree:
Multiple widgets used the same GlobalKey.
The key [GlobalKey#4c84a] was used by multiple widgets. The parents of those widgets were different widgets that both had the following description:
在Flutter开发中遇到异常'Multiple widgets used the same GlobalKey',这表明有两个小部件同时使用了相同的GlobalKey。这种用法是不被允许的。解决方法是在发生错误的代码行设置断点,通过Flutter的调用栈来定位具体问题。务必确保每个GlobalKey唯一。
订阅专栏 解锁全文
2万+

被折叠的 条评论
为什么被折叠?



