我有一个Flutter小部件,根据屏幕大小显示额外的数据.有没有人知道在多种不同的屏幕尺寸上测试这个小部件的方法?
我已经浏览了widget_tester源代码,但找不到任何东西.
赏金信息:如果出现以下情况,我会接受您的回答:
\ndo this instead\n\n[编辑:07/02/21] 在flutter 社区 上关注 Miyoyo#5957 ,\ndiscord
\n\n@iapicca Convert widget position to global, get width height, add both, and see if the resulting bottom right position is on screen?并使用以下答案作为参考:
给出下面的代码示例(也可以在 dartpad 上运行)
\nimport \'package:flutter_test/flutter_test.dart\';\nimport \'package:flutter/material.dart\';\n\nfinal _testKey = GlobalKey();\nconst _fabKey = ValueKey(\'fab\');\nfinal _onScreen = ValueNotifier<bool>(true);\n\nvoid main() => runApp(_myApp);\n\nconst _myApp = …Run Code Online (Sandbox Code Playgroud)