get method Null safety

Logic get(
  1. Logic logic,
  2. [int? stageIndex]
)

Gets the pipelined version of logic. By default stageIndex is the last stage (the output of the pipeline).

If the signal is not already a part of this Pipeline, the signal will be added to the Pipeline. Use stageIndex to select the value of logic at a specific stage of the pipeline.

Implementation

Logic get(Logic logic, [int? stageIndex]) {
  if (!_isRegistered(logic)) {
    _add(logic);
  }

  stageIndex ??= _stages.length - 1;

  final stageLogic = _stages[stageIndex].main[logic]!;
  return stageLogic;
}