Use auto-complete for private transitive dependencies in Dart/Flutter

Viewed 392

Summary

While I understand why it could be dangerous to auto import transitive public dependencies, is there a way to enable auto-import when depending a local package via path?

Setup

The Flutter/Dart project consists of three packages

  • app
  • repository
  • api_client (auto-generated open api & models)

I do need api_client models in app & repository, but only want to import it in the repository package.

app/pubspec.yaml

dependencies:
  # want to remove api_client here without loosing auto-import ability
  api_client:
    path: ../api_client 
  repository:
    path: ../repository

repository/pubspec.yaml

dependencies:
  api_client:
    path: ../api_client 
0 Answers
Related