operator == method Null safety

bool operator == (
  1. Object other
)
override

Equality for Pointers only depends on their address.

Implementation

bool operator ==(Object other) {
  if (other is! Pointer) return false;
  Pointer otherPointer = other;
  return address == otherPointer.address;
}