contains method

bool contains(
  1. T element
)

Implementation

bool contains(T element) {
  var currentNode = _head;
  while (currentNode != null) {
    if (currentNode.data == element) return true;
    currentNode = currentNode.next;
  }
  return false;
}