lookupPortByName method Null safety

SendPort? lookupPortByName(
  1. String name
)

Looks up the SendPort associated with a given name.

Returns null if the name does not exist. To register the name in the first place, consider registerPortWithName.

The name argument must not be null.

Implementation

static SendPort? lookupPortByName(String name) {
  assert(name != null, "'name' cannot be null.");
  return _lookupPortByName(name);
}