ConvertIterableMapToCollectionFor class

Converts an iterable call to Iterable.map with an optional collect Iterable.toList/Iterable.toSet to a collection-for idiom.

Example:

final iterable = [1, 2, 3];
final someList = iterable.map((e) => e * 2).toList();
final someSet = iterable.map((e) => e / 2).toSet();

When assist is applied to someList and someSet the result is

final iterable = [1, 2, 3];
final someList = [for(final e in iterable) e * 2];
final someSet = {for(final e in iterable) e / 2};

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
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

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

Operators

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