6

I have a project which consists of one runable project and multiple local packages. These packages are modules and a core framework. I am using json serialization and other packages which depend on build_runner. The problem I am facing is that if I add a class which needs build_runner to do it's work, I always have to navigate through the folders within the Terminal, and run the build_runner manually. Is there a way to tell the build_runner to run on all local packages or at least ob the defined ones?

I have found an other SO Thread with quiet the same problem here, which suggests to use build_config package, but I am not sure, if this task is possible with this package

DirtyNative
  • 2,553
  • 2
  • 33
  • 58

1 Answers1

1

For everyone facing the same issue, I built a good workflow for myself which I want to share.

I am using VSCode, so I don't know how to act with this in Android Studio or any other IDE.

In VSCode, you can have multiple Terminals open. Go to Terminal => New Terminal. This will ask you which project you want that Terminal to be opened. There you can select your second project which depends on build_runner and from there, you can start a watcher with

flutter pub run build_runner watch

Whenever you do changes inside this second project, the build_runner will generate the desired files without the need to manually navigate through your projects

DirtyNative
  • 2,553
  • 2
  • 33
  • 58