operator == method

  1. @override
bool operator ==(
  1. dynamic other
)
override

Determines equality by serializing both values.

Implementation

@override
operator ==(other) {
  if (other is UdpPacket &&
      sourcePort == other.sourcePort &&
      destinationPort == other.destinationPort &&
      payload == other.payload) {
    final parent = this.parentPacket;
    final otherParent = other.parentPacket;
    if (parent == null) {
      return otherParent == null;
    }
    return parent.source == otherParent.source &&
        parent.destination == otherParent.destination;
  } else {
    return false;
  }
}