提问人:Jiajun He 提问时间:10/20/2023 更新时间:10/20/2023 访问量:25
Flutter 如何通过导航器获取小部件
Flutter how to get the widgets by the navigator
问:
在显示页面时,我需要收集有关页面元素的信息。如何在推送后获取有关页面元素的所有信息。
喜欢这个:
@override
void onPagePush(Route route) {
super.onPagePush(route);
//top widget
Widget widget = route.navigator?.overlay?.widget;
List<Widget> widgetList = [];
for(int i = 0; i<widget.childCount; i++){
widgetList.add(widget.getChildren(i));
}
...
}
答: 暂无答案
评论