run method
void
run(
- CustomLintResolver resolver,
- ErrorReporter reporter,
- CustomLintContext context
Registers this rule to listen to ArgumentList
nodes and checks arguments
passed to widget constructors.
Implementation
@override
void run(
CustomLintResolver resolver,
ErrorReporter reporter,
CustomLintContext context,
) {
context.registry.addArgumentList((argumentList) {
if (argumentList.parent case InstanceCreationExpression object) {
final superTypes =
object.constructorName.element?.returnType.allSupertypes;
superTypes?.forEach((type) {
if (!_widgetChecker.isExactlyType(type)) return;
_checkParameters(reporter, argumentList);
});
}
});
}