clone method

  1. @override
  2. @mustBeOverridden
PairInterface clone()
inherited

Creates a new Interface with the same ports as this.

It is expected that any implementation will override this in a way that returns the same type as itself.

Implementation

@override
@mustBeOverridden
PairInterface clone() => PairInterface(
      portsFromConsumer: _getMatchPorts(this, PairDirection.fromConsumer),
      portsFromProvider: _getMatchPorts(this, PairDirection.fromProvider),
      sharedInputPorts: _getMatchPorts(this, PairDirection.sharedInputs),
      commonInOutPorts: _getMatchPorts(this, PairDirection.commonInOuts),
      // Preserve the deprecated callback on clones for legacy consumers.
      // ignore: deprecated_member_use_from_same_package
      modify: modify,
    );