unused_element_parameter
A value for optional parameter '{0}' isn't ever given.
Description
#The analyzer produces this diagnostic when a value is never passed for an optional parameter declared within a private declaration.
Example
#Assuming that no code in the library passes a value for y
in any
invocation of _m
, the following code produces this diagnostic:
dart
class C {
void _m(int x, [int? y]) {}
void n() => _m(0);
}
Common fixes
#If the declaration isn't needed, then remove it:
dart
class C {
void _m(int x) {}
void n() => _m(0);
}
除非另有说明,文档之所提及适用于 Dart 3.7.3 版本,本页面最后更新时间: 2025-05-08。 查看文档源码 或者 报告页面问题。