insertPart method

void insertPart({
  1. required int index,
  2. required MutablePart mutablePart,
})

Inserts a part into the mutable part collection at the specified part index.

The part index can be equal to the part count and this is equivalent to adding a part to the end of the collection.

Parameters:

  • index — Zero-based index of the part.
  • mutablePart — The part to insert.

Implementation

void insertPart({
  required int index,
  required MutablePart mutablePart,
}) {
  _withThrowingErrorHandler((errorHandler) {
    runtimecore.RT_MutablePartCollection_insertPart(
      _handle,
      index,
      mutablePart._handle,
      errorHandler,
    );
  });
}