小编呂學洲*_*呂學洲的帖子

测试时如何检查小部件是否可见

就我而言,当我使用 时ExpansionPanelList,我需要检查面板内的小部件是否可见。

如果不可见,tester.tap(find.text('More Info'))将抛出异常:

Warning: A call to tap() with finder "exactly one widget with text "More Info" (ignoring offstage widgets): Text("More Info", dependencies: [MediaQuery, DefaultTextStyle])" derived an Offset (Offset(400.0, 641.8)) that would not hit test on the specified widget. Maybe the widget is actually off-screen, or another widget is obscuring it, or the widget cannot receive pointer events. Indeed, Offset(400.0, 641.8) is outside the bounds of the root of the render tree, Size(800.0, 600.0). The …
Run Code Online (Sandbox Code Playgroud)

testing flutter widget-test-flutter

7
推荐指数
1
解决办法
6747
查看次数

标签 统计

flutter ×1

testing ×1

widget-test-flutter ×1