Card constructor

Card({
  1. required CardSet cardSet,
  2. required int orderInSet,
  3. required String name,
  4. required Set<Aspect> aspects,
  5. bool unique = false,
})

Creates a card with the given cardSet, orderInSet, name, aspects.

Errors

This class is not intended to be used with user-provided input, and as such does not provide any error handling. If any of the fields are invalid, an error will be thrown.

Implementation

Card({
  required this.cardSet,
  required this.orderInSet,
  required this.name,
  required this.aspects,
  this.unique = false,
}) {
  _checkOrderInSet();
  _checkAspectsLength();
  checkNotEmpty(value: name, name: 'name');
}