replaceLast method

void replaceLast(
  1. Decorator? decorator
)

Implementation

void replaceLast(Decorator? decorator) {
  if (decorator == null) {
    removeLast();
  } else if (isLastDecorator || _next!.isLastDecorator) {
    _next = decorator;
  } else {
    _next!.replaceLast(decorator);
  }
}