card_shuffler_2 library

A Dart package for shuffling, dealing, and managing playing card decks.

Features

  • Standard 52-card deck or custom decks
  • Three shuffle algorithms: Fisher-Yates, Riffle, Overhand
  • Deal cards to multiple players
  • Cut the deck
  • Reset to original order

Quick Start

import 'package:card_shuffler/card_shuffler.dart';

void main() {
  final deck = CardDeck.standard();
  deck.shuffle(); // Fisher-Yates by default
  final hand = deck.deal(5);
  print(hand); // e.g. [A♠, 7♥, 3♦, K♣, 10♠]
}

Classes

CardDeck
A deck of PlayingCards with shuffle, deal, cut, and reset capabilities.
CardShuffler
Provides static shuffle methods for a list of items.
DealResult
The result of dealing hands from a CardDeck.
HandDealer
Utility for dealing multiple hands from a CardDeck.
PlayingCard
Represents a single playing card with a rank and suit.

Enums

Rank
Represents the rank (face value) of a playing card.
ShuffleAlgorithm
Defines the algorithm used to shuffle a deck of cards.
Suit
Represents a suit of a playing card.