existItem method

bool existItem(
  1. String id
)

API to check the item is existing or not.

Parameters: id ID to be checked item.

Return 'true', if there is item.

Exceptions: Throws an ArgumentError if the ID is empty.

Implementation

bool existItem(String id) {
  if (id.isEmpty) {
    throw ArgumentError("existItem : You must set ID.");
  }
  if (_getIndex(0, id) > -1) {
    return true;
  } else {
    return false;
  }
}