How can I see dependency diagram in flutter?

心已入冬 提交于 2019-12-08 13:36:59

问题


Is there a way to see how packages in my flutter project depend on each other? Under packages I mean internal packages: folders under 'lib'. Also, it would be great to check for circular dependencies between the packages.


回答1:


While I did not find a tool to detect dependencies, I prefix my folders with numbers, ordering them by abstraction level: higher level at the top, and lower level at the bottom.

And, to avoid circular dependencies, I watch the packages to reference only larger numbers, not smaller:




回答2:


You can use below command to see your flutter app's dependency graph.

flutter pub deps

The dependency information is printed as a tree, a list, or a compact list.



来源:https://stackoverflow.com/questions/57174506/how-can-i-see-dependency-diagram-in-flutter

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!