find method

Card find(
  1. int orderInSet
)

Looks up a card in this collection by its orderInSet.

If the card is not found, throws a StateError.

NOTE: This method is not highly optimized.

Implementation

Card find(int orderInSet) {
  final result = tryFind(orderInSet);
  if (result != null) {
    return result;
  }
  throw StateError('Card not found: $orderInSet');
}