我收到以下错误。什么是hitTest()以及导致此问题的可能原因是什么?
E / flutter(31408):[ERROR:flutter / lib / ui / ui_dart_state.cc(157)]未处理的异常:无法命中测试从未布置过的渲染框。
E / flutter(31408):在此RenderBox上调用了hitTest()方法:RenderErrorBox#f4f7d NEEDS-LAYOUT NEEDS-PAINT:
E / flutter(31408):创建者:ErrorWidget-[#68dde ]←ListTileTheme←DrawerController- [LabeledGlobalKey#23759]←MediaQuery←LayoutId-[<_ ScaffoldSlot.drawer>]←CustomMultiChildLayout←AnimatedBuilder←DefaultTextStyle←AnimatedDefaultTextStyle←_InkFeatures←[GlobalKey#b796f墨水渲染器] > E / flutter(31408):parentData:offset = Offset(0.0,0.0); id = _ScaffoldSlot.drawer
E / flutter(31408):约束:MISSING
E / flutter(31408):大小:MISSING
E / flutter(31408):不幸的是,该对象的几何形状是目前尚不知道,可能是因为它从未被布局过。这意味着无法对其进行准确的命中测试。
E / flutter(31408):如果您尝试在布局阶段本身执行一次命中测试,请确保仅命中已完成布局的测试节点(例如,节点的子节点,其layout()方法具有被称为)。
E / flutter(31408):#0 RenderBox.hitTest。 (package:flutter / src / rendering / box.dart:2102:11)
E / flutter(31408):#1 RenderBox.hitTest(package:flutter / src / rendering / box.dart:2133:6)
E / flutter(31408):#2 RenderBoxContainerDefaultsMixin.defaultHitTestChildren。 (package:flutter / src / rendering / box.dart:2488:24)
E / flutter(31408):#3 BoxHitTestResult.addWithRawTransform(package:flutter / src / rendering / box.dart:801:31)
E / flutter(31408):#4 BoxHitTestResult.addWithPaintOffset(包:flutter / src / rendering / box.dart:758:12)
E / flutter(31408):#5 RenderBoxContainerDefaultsMixin.defaultHitTestChildren(包:flutter / src / rendering / box.dart:2483:33)
E / flutter(31408):#6 RenderCustomMultiChildLayoutBox.hitTestChildren(包:flutter / src / rendering / custom_layout.dart:401:12)< br /> E / flutter(31408):#7 RenderBox.hitTest(package:flutter / src / rendering / box.dart:2135:11)
E / flutter(31408):#8 RenderProxyBoxMixin.hitTestChildren(package :flutter / src / rendering / proxy_box.dart:114:19)
E / flutter(31408):#9 RenderBox.hitTest(package:flutter / src / rendering / box.dart:2135:11)
E / flutter(31408):#10 RenderProxyBoxMixin.hitTestChildren(包年龄:flutter / src / rendering / proxy_box.dart:114:19)
E / flutter(31408):#11 RenderBox.hitTest(包:flutter / src / rendering / box.dart:2135:11)< br /> E / flutter(31408):#12 RenderPhysicalModel.hitTest(package:flutter / src / rendering / proxy_box.dart:1722:18)
E / flutter(31408):#13 RenderProxyBoxMixin.hitTestChildren(package :flutter / src / rendering / proxy_box.dart:114:19)
E / flutter(31408):#14 RenderBox.hitTest(包:flutter / src / rendering / box.dart:2135:11)
/> E / flutter(31408):#15 RenderProxyBoxMixin.hitTestChildren(package:flutter / src / rendering / proxy_box.dart:114:19)
E / flutter(31408):#16 RenderBox.hitTest(package: flutter / src / rendering / box.dart:2135:11)
E / flutter(31408):#17 RenderProxyBoxMixin.hitTestChildren(package:flutter / src / rendering / proxy_box.dart:114:19)
E / flutter(31408):#18 RenderBox.hitTest(包:flutter / src / rendering / box.dart:2135:11)
E / flutter(31408): #19 RenderIgnorePointer.hitTest(包:flutter / src / rendering / proxy_box.dart:3064:31)
E / flutter(31408):#20 RenderProxyBoxMixin.hitTestChildren(包:flutter / src / rendering / proxy_box.dart :114:19)
E / flutter(31408):#21 RenderBox.hitTest(包:flutter / src / rendering / box.dart:2135:11)
E / flutter(31408):# 22 RenderProxyBoxMixin.hitTestChildren(package:flutter / src / rendering / proxy_box.dart:114:19)
E / flutter(31408):#23 RenderFractionalTranslation.hitTestChildren。 (包装:flutter / src / rendering / proxy_box.dart:2453:22)
E / flutter(31408):#24 BoxHitTestResult.addWithRawTransform(包装:flutter / src / rendering / box.dart:801:31)
E / flutter(31408):#25 BoxHitTestResult.addWithPaintOffset(包:flutter / src / rendering / box.dart:758:12)
E / flutter(31408):#26 RenderFractionalTranslation.hitTestChildren(包:flutter / src / rendering / proxy_box.dart:2447:19)
E / flutter(31408):#27 RenderFractionalTranslation.hitTest(包:flutter / src / rendering / proxy_box.dart:2433:12)< br /> E / flutter(31408):#28 RenderProxyBoxMixin.hitTestChildren(软件包:flutter / src / rendering / proxy_box.dart:114:19)
E / flutter(31408):#29 RenderBox.hitTest(软件包:flutter / src / rendering / box.dart:2135:11)
E / flutter(31408):#30 RenderProxyBoxMixin.hitTestChildren(package:flutter / src / rendering / proxy_box.dart:114:19)
/> E / flutter(31408):#31 RenderBox.hitTest(package:flutter / src /rendering/box.dart:2135:11)
E / flutter(31408):#32