PlayingCard class

Represents a single playing card with a rank and suit.

Example:

final card = PlayingCard(rank: Rank.ace, suit: Suit.spades);
print(card); // A♠

Constructors

PlayingCard({required Rank rank, required Suit suit})
Creates a PlayingCard with the given rank and suit.
const

Properties

hashCode int
The hash code for this object.
no setteroverride
rank Rank
The rank (face value) of this card.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
suit Suit
The suit of this card.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
Returns the short display string, e.g. "A♠", "10♥".
override

Operators

operator ==(Object other) bool
Returns true if this card has the same rank and suit as other.
override