按下返回按钮会引发巨大异常

时间:2019-10-27 11:22:07

标签: exception flutter

每次我尝试按手机的“后退”按钮时,颤振控制台都会引发此异常。如果我只是尝试从内置按钮进行POP,则不会发生这种情况。可能是什么原因造成的?我不太了解。

该异常一直持续到n°400或更强,然后才回到上一个屏幕

════════ Exception caught by widgets library ═══════════════════════════════════════════════════════
The following assertion was thrown while dispatching notifications for FocusManager:
Looking up a deactivated widget's ancestor is unsafe.

At this point the state of the widget's element tree is no longer stable.

To safely refer to a widget's ancestor in its dispose() method, save a reference to the ancestor by calling inheritFromWidgetOfExactType() in the widget's didChangeDependencies() method.

When the exception was thrown, this was the stack: 
#0      Element._debugCheckStateIsActiveForAncestorLookup.<anonymous closure> (package:flutter/src/widgets/framework.dart:3406:9)
#1      Element._debugCheckStateIsActiveForAncestorLookup (package:flutter/src/widgets/framework.dart:3420:6)
#2      Element.inheritFromWidgetOfExactType (package:flutter/src/widgets/framework.dart:3435:12)
#3      Focus.of (package:flutter/src/widgets/focus_scope.dart:266:41)
#4      _InkResponseState._handleFocusUpdate (package:flutter/src/material/ink_well.dart:629:39)
...
The FocusManager sending notification was: FocusManager#2a4e1
  primaryFocus: FocusScopeNode#e5462
════════════════════════════════════════════════════════════════════════════════════════════════════

════════ (2) Exception caught by widgets library ═══════════════════════════════════════════════════
Looking up a deactivated widget's ancestor is unsafe.
════════════════════════════════════════════════════════════════════════════════════════════════════

════════ (3) Exception caught by widgets library ═══════════════════════════════════════════════════
Looking up a deactivated widget's ancestor is unsafe.
═════════════════════════════════════════════════════════

0 个答案:

没有答案