admin管理员组

文章数量:1208153

I want to manage the dependencies for two Flutter apps and a shared package within a Melos monorepo efficiently

I used this example I found in the Melos documentation:

# melos.yaml
# ...
command:
  bootstrap:
    environment:
      sdk: ">=3.0.0 <4.0.0"
      flutter: ">=3.0.0 <4.0.0"
    dependencies:
      collection: ^1.18.0
      integral_isolates: any
      uni_links2:
      uni_links_macos:
        git: .git
    
    dev_dependencies:
      build_runner: ^2.3.3
# ...

I assumed that with this and after running melos bootstrap and flutter pub get in my apps, I would be able to use the build runner in my apps without actually declaring the dependency in their respective pubspec.yaml files, however I get the error Could not find package 'build_runner' or file 'build_runner'.

I also tried specifying the dependencies in the projects root pubspec.yaml but that didn't work either. What am I missing?

I'm grateful for all your help.

本文标签: Can you share dependencies between flutter packages in Melos and howStack Overflow