cc-nogueira · GitHub

Is your feature request related to a problem? Please describe.
I regularly work in Flutter with multi-root projects for enforced clean architecture. This is great to assert separation of concerns at package level.

  • presentation layer does no see the data layer, it must access data through the domain layer
  • domain layer does not see the data layer, it must receive implementation injections of its interfaces
  • and so on...

This works beautifully the only downside is that when I add a package to a layer pubspec.yaml, say the _presentation layer, Dart extension will run pub get for me and I can continue coding... but when the app reloads that lib won't be delivered to my device unless I also run pub get on the main project yaml.

Describe the solution you'd like
Thus I would like to have an option in this Dart extension to run pub get on the parent project whenever it is run on sub packages.

Describe alternatives you've considered
I sometimes turn off automatic pub get on pubspec changes, and use a command line script that runs pub get on the current package and on the main project.... This works but is not that convenient.

Additional context
The structure I use is available as a template in https://github.com/cc-nogueira/flutter_layered_template, and it uses the common multi-package structure under the packages folder, each one defined as a root folder for VSCode.

  • main project
    • lib/main.dart
    • packages/
      • coreLayer/*
      • dataLayer/*
      • domainLayer/*
      • presentationLayer/*
      • servicesLayer/*
      • diLayer/* (dependency injection layer that see all layers and configures them at app initialization)

King rasgards,

Ricardo

Read the original on github.com ↗