equals method Null safety

bool equals(
  1. E e1,
  2. E e2
)

Compare two elements for being equal.

This should be a proper equality relation.

Implementation

bool equals(E e1, E e2);