Contribution class abstract

A change to one Dart file, such as an import to add or a widget to replace.

A contribution parses the file without resolving it, so it finds its target by the names written in the source. Each subclass says what it does when the target is missing, and whether it reformats the whole file with dartFormater after the edit.

PatchEngine applies contributions to a project and renders the Mustache placeholders in the text they insert.

Implementers

Constructors

Contribution({required String file})
Creates a change to file.
const

Properties

dartFormater → DartFormatter
The formatter contributions run over the code they produce.
no setter
file → String
The path of the file to change, relative to the project root.
final
hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

apply(String original) → Future<String>
Returns original, the content of file, with this change applied.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

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