Skip to content

Add 'package' to dependencies - false-negative #5913

@FMorschel

Description

@FMorschel

Describe the bug
The depend_on_referenced_packages diagnostic shows up but not the fix.

To Reproduce
Steps to reproduce the behavior:

  1. Add a dev dependency to a blank project (for example path)
  2. Use it under lib
  3. See the diagnostic but no fix

Expected behavior
For a quick-fix to show up, which would move that declaration between dev_dependencies and dependencies (maybe dependency_overrides).

Please complete the following information:

Workspace Environment
Dart Code extension: 3.129.20260202
Flutter extension: 3.129.20260202 (activated)

App: Visual Studio Code
App Host: desktop
Version: win 1.109.4

Workspace type: Dart, Flutter (LSP)
Workspace name: workspace

Dart (3.12.0-154.0.dev): C:\Users\felip_0vh5fa6\.puro\shared\caches\6e4a481bdf2793a05a2569693d3b88b200159217\dart-sdk
Flutter (3.42.0-1.0.pre-153): C:\Users\felip_0vh5fa6\.puro\envs\master\flutter (Windows (windows-x64/windows))

Output from 'dart info'

C:\Users\felip_0vh5fa6\.puro\shared\caches\6e4a481bdf2793a05a2569693d3b88b200159217\dart-sdk\bin\dart.exe info

If providing this information as part of reporting a bug, please review the information
below to ensure it only contains things you're comfortable posting publicly.

General info

  • Dart 3.12.0-154.0.dev (dev) (Mon Feb 16 12:09:02 2026 -0800) on "windows_x64"
  • on windows / "Windows 11 Pro" 10.0 (Build 26200)
  • locale is pt-BR

Project info

  • sdk constraint: '^3.11.0'
  • dependencies:
  • dev_dependencies: flutter_lints

Process info

Memory CPU Elapsed time Command line
0 MB -- dart.exe
0 MB -- dart.exe
0 MB -- dart.exe
0 MB -- dart.exe
0 MB -- dart.exe
0 MB -- dart.exe
0 MB -- dart.exe
0 MB -- dart.exe
0 MB -- dart.exe
0 MB -- dart.exe
0 MB -- dart.exe
0 MB -- dartvm.exe
0 MB -- dartvm.exe
0 MB -- dartvm.exe
Output from 'flutter doctor'

C:\Users\felip_0vh5fa6\.puro\envs\master\flutter\bin\flutter.bat doctor -v

[!] Flutter (Channel [user-branch], 3.42.0-1.0.pre-153, on Microsoft Windows [Version 10.0.26200.7840], locale pt-BR) [3,3s]
    ! Flutter version 3.42.0-1.0.pre-153 on channel [user-branch] at C:\Users\felip_0vh5fa6\.puro\envs\master\flutter
      Currently on an unknown channel. Run `flutter channel` to switch to an official channel.
      If that doesn't fix the issue, reinstall Flutter by following instructions at https://flutter.dev/setup.
    ! Warning: `flutter` on your path resolves to C:\Users\felip_0vh5fa6\.puro\envs\stable\flutter\bin\flutter, which is not inside your current Flutter SDK checkout at C:\Users\felip_0vh5fa6\.puro\envs\master\flutter. Consider adding C:\Users\felip_0vh5fa6\.puro\envs\master\flutter\bin to the front of your path.
    ! Warning: `dart` on your path resolves to C:\Users\felip_0vh5fa6\dart\bin\dart.exe, which is not inside your current Flutter SDK checkout at C:\Users\felip_0vh5fa6\.puro\envs\master\flutter. Consider adding C:\Users\felip_0vh5fa6\.puro\envs\master\flutter\bin to the front of your path.
    ! Unknown upstream repository.
      Reinstall Flutter by following instructions at https://flutter.dev/setup.
    • Framework revision 6e4a481bdf (2 days ago), 2026-02-17 09:45:34 -0800
    • Engine revision 6e4a481bdf
    • Dart version 3.12.0 (build 3.12.0-154.0.dev)
    • DevTools version 2.55.0
    • Feature flags: enable-web, enable-linux-desktop, enable-macos-desktop, enable-windows-desktop, enable-android, enable-ios, cli-animations, enable-native-assets, omit-legacy-version-file, enable-lldb-debugging, enable-uiscene-migration, enable-riscv64
    • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades.

[√] Windows Version (11 Pro 64-bit, 25H2, 2009) [13,8s]

[√] Android toolchain - develop for Android devices (Android SDK version 36.1.0) [13,2s]
    • Android SDK at C:\Users\felip_0vh5fa6\AppData\Local\Android\sdk
    • Emulator version 36.2.12.0 (build_id 14214601) (CL:N/A)
    • Platform android-36.1, build-tools 36.1.0
    • Java binary at: C:\Users\felip_0vh5fa6\AppData\Local\Programs\Android Studio 2\jbr\bin\java
      This is the JDK bundled with the latest Android Studio installation on this machine.
      To manually set the JDK path, use: `flutter config --jdk-dir="path/to/jdk"`.
    • Java version OpenJDK Runtime Environment (build 21.0.6+-13368085-b895.109)
    • All Android licenses accepted.

[√] Chrome - develop for the web [695ms]
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.14.20) [689ms]
    • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
    • Visual Studio Community 2022 version 17.14.36705.20
    • Windows 10 SDK version 10.0.26100.0

[√] Connected device (5 available) [3,5s]
    • SM G780F (wireless) (mobile) • adb-RX8R30G5WDH-h0vKcv._adb-tls-connect._tcp • android-arm64  • Android 13 (API 33)
    • SM G780F (mobile)            • dev-phone:36941                              • android-arm64  • Android 13 (API 33)
    • Windows (desktop)            • windows                                      • windows-x64    • Microsoft Windows [Version 10.0.26200.7840]
    • Chrome (web)                 • chrome                                       • web-javascript • Google Chrome 143.0.7499.193
    • Edge (web)                   • edge                                         • web-javascript • Microsoft Edge 144.0.3719.115

[√] Network resources [1.612ms]
    • All expected network resources are available.

! Doctor found issues in 1 category.

Metadata

Metadata

Assignees

No one assigned

    Labels

    in editorRelates to code editing or language featuresis bug

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions