Flutter:如何识别小部件是否为容器() / listTile()?
如果我有一个由空容器()和listTile()随机顺序组成的ListView Builder,我该如何确定在特定索引处出现哪个小部件?
if i have a listview builder which is comprised of empty Container() and ListTile() in random order, how can i identify which widget appeared at particular index ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用
print(widget.runtimetype);
确定小部件的类型。You can use
print(widget.runtimeType);
to determine the type of a widget.