关闭。这个问题需要debugging details .它目前不接受答案。
想改进这个问题?将问题更新为 on-topic对于堆栈溢出。
1年前关闭。
Improve this question
当我尝试使用可见性隐藏小部件时,隐藏的小部件占据了一个空白位置,如附加的屏幕截图。如何解决这个问题?
src gist
最佳答案
使用SizedBox flutter , 每当您想显示一个空/空项目以隐藏该项目时
// Without visibility you can use
_dynamicListMenu[index].name == "profile" ? Your_widget_to_show : SizedBox()
关于Flutter Visibility 小部件占据空白位置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63480541/