insertConstructor abstract method

void insertConstructor(
  1. CompilationUnitMember container,
  2. void buildEdit(
    1. DartEditBuilder builder
    )
)

Inserts the code for a constructor.

The constructor is inserted after the last existing field or constructor, or if the sort_constructors_first lint rule is enabled, after the last existing constructor.

Throws an exception if container is not a CompilationUnitMember which can have constructor declarations.

Implementation

void insertConstructor(
  CompilationUnitMember container,
  void Function(DartEditBuilder builder) buildEdit,
);