Is there a way to see how libraries in my Flutter package depend on each other? Under libraries, I mean internal libraries, dart files under 'lib'. Also, it would be great to check for circular dependencies between the libraries.
LayerLens can continuously auto-generate dependency diagrams for your package.
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.
--no-dev
option to hide dev_dependencies
. –
Mita I was also looking for a tool to show internal dependencies but couldn't find one. So I wrote a tool called Lakos to visualize Dart/Flutter library dependencies in Graphviz. Lakos will visualize dependencies inside your project, not external package dependencies. Lakos will also warn about dependency cycles with an exit code.
https://pub.dev/packages/lakos
Example usage:
lakos --metrics . | dot -Tpng -Gdpi=200 -o lakos_example.png
The output will look similar to this:
LayerLens can continuously auto-generate dependency diagrams for your package.
© 2022 - 2024 — McMap. All rights reserved.