unnecessary_dev_dependency
The dev dependency on {0} is unnecessary because there is also a normal dependency on that package.
Description
#The analyzer produces this diagnostic when there's an entry under
dev_dependencies
for a package that is also listed under dependencies
.
The packages under dependencies
are available to all of the code in the
package, so there's no need to also list them under dev_dependencies
.
Example
#The following code produces this diagnostic because the package meta
is
listed under both dependencies
and dev_dependencies
:
name: example
dependencies:
meta: ^1.0.2
dev_dependencies:
meta: ^1.0.2
Common fixes
#Remove the entry under dev_dependencies
(and the dev_dependencies
key
if that's the only package listed there):
name: example
dependencies:
meta: ^1.0.2
除非另有说明,文档之所提及适用于 Dart 3.7.3 版本,本页面最后更新时间: 2025-05-08。 查看文档源码 或者 报告页面问题。