显示Flutter导航堆栈 [英] Show Flutter Navigation stack

查看:143
本文介绍了显示Flutter导航堆栈的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想查看Flutter中的导航堆栈.是否可以使用Navigator类来打印导航堆栈和有关Navigator内部内容的其他元信息?

I want to see the navigation stack in Flutter. Is it possible to use the Navigator class to print the navigation stack and other meta info about what's inside the Navigator?

使用print()方法打印Navigator只是将Navigator作为字符串.

Printing the Navigator with the print() method just gives the Navigator as a string.

预期结果:Navigator : { params...., params.... }

推荐答案

我认为您当前唯一的方法就是覆盖Navigator类并自己跟踪路由.

I think the only way you could do this currently is to override the Navigator class and keep track of the Routes yourself.

如果您查看

If you look at the Navigator source code there is a variable called _history which contains all the navigated routes but there's no way to access it unfortunately.

这篇关于显示Flutter导航堆栈的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆