ChangeWidgetNameFix class

A fix that replaces the widget constructor name with a new one specified as widgetName.

Assumption: the corresponding lint diagnostic reports an error whose source range matches the constructor's name (identifier). The fix applies the replacement to that exact range.

Example:

Container(alignment: null, child: const SizedBox());

will be replaced with:

Align(alignment: null, child: const SizedBox());

Constructors

ChangeWidgetNameFix.new(String widgetName)

Properties

filesToAnalyze List<String>
A list of glob patterns matching the files that run cares about.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
id String
A unique ID for a fix. Must be unique across all fixes of any package.
latefinalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
widgetName String
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
run(CustomLintResolver resolver, ChangeReporter reporter, CustomLintContext context, Diagnostic diagnostic, List<Diagnostic> diagnostics) → void
Emits lints for a given file.
startUp(CustomLintResolver resolver, CustomLintContext context) Future<void>
Emits lints for a given file.
inherited
testAnalyzeAndRun(File file, AnalysisError analysisError, List<AnalysisError> others) Future<List<PrioritizedSourceChange>>
Analyze a Dart file and runs this fix in test mode.
inherited
testRun(ResolvedUnitResult result, AnalysisError analysisError, List<AnalysisError> others, {Pubspec? pubspec}) Future<List<PrioritizedSourceChange>>
Runs this fix in test mode.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited