insertIntoUnitMember abstract method

void insertIntoUnitMember(
  1. CompilationUnitMember compilationUnitMember,
  2. void buildEdit(
    1. DartEditBuilder builder
    ), {
  3. bool lastMemberFilter(
    1. ClassMember existingMember
    )?,
})

Inserts into a CompilationUnitMember.

The new member is inserted at an offset determined by lastMemberFilter.

If lastMemberFilter is omitted, the new member is inserted after all existing members.

Otherwise, the offset is just after the last member of compilationUnitMember that matches lastMemberFilter. If no existing member matches, then the offset is at the beginning of compilationUnitMember, just after it's opening brace.

Implementation

void insertIntoUnitMember(
  CompilationUnitMember compilationUnitMember,
  void Function(DartEditBuilder builder) buildEdit, {
  bool Function(ClassMember existingMember)? lastMemberFilter,
});