addDartFileEdit abstract method

Future<void> addDartFileEdit(
  1. String path,
  2. FutureOr<void> buildFileEdit(
    1. DartFileEditBuilder builder
    ), {
  3. ImportPrefixGenerator importPrefixGenerator,
  4. bool createEditsForImports = true,
})

Use the buildFileEdit function to create a collection of edits to the file with the given path. The edits will be added to the source change that is being built.

The builder passed to the buildFileEdit function has additional support for working with Dart source files.

Setting createEditsForImports to false will prevent edits being produced to add import statements for any unimported types.

Implementation

Future<void> addDartFileEdit(String path,
    FutureOr<void> Function(DartFileEditBuilder builder) buildFileEdit,
    {ImportPrefixGenerator importPrefixGenerator,
    bool createEditsForImports = true});