addOutput method Null safety

  1. @protected
Logic addOutput(
  1. String name,
  2. {int width = 1}
)

Registers an output to this Module and returns an output port that can be driven.

The return value is the same as what is returned by output().

Implementation

@protected
Logic addOutput(String name, {int width = 1}) {
  _checkForSafePortName(name);
  _outputs[name] = Logic(name: name, width: width);

  // ignore: invalid_use_of_protected_member
  _outputs[name]!.parentModule = this;

  return _outputs[name]!;
}