Skip to content
pubscout

card_game

2.0.0, released 2 years ago by jlogical.com

A declarative Flutter package for building card games with drag-and-drop, animations, and flexible layouts.

WASM-ready
$ flutter pub add card_game
Source repository

What it does

A declarative Flutter package for building card games with drag-and-drop, animations, and flexible layouts. It provides standard playing cards and numeric cards out of the box, along with built-in validation for card movements.

AI-written summary of version 2.0.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You are building a card game like Solitaire, War, or Memory Match in Flutter.
  • You need drag-and-drop functionality with movement validation for cards.
  • You want smooth animations for card movements and flips.

Skip it when

  • You are building a non-card-based 2D or 3D game that requires a full game engine.
  • You require complex physics simulations outside of card stacking and dragging.

Strengths

  • Declarative API with no controllers needed
  • Built-in drag-and-drop support with validation
  • Smooth built-in animations for movements and flips
  • Supports standard playing cards and custom numeric cards

Weaknesses

  • Limited to card-based games
  • Requires managing state for the game externally (e.g., via hooks or state management)

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
4

not documented

CardGame<int, int>(
  style: numericCardStyle(),
  children: [
    SafeArea(
      child: Column(
        children: [
          CardColumn<int, int>(
            value: 0,
            values: [1, 2, 3],
            maxGrabStackSize: 1,
          ),
        ],
      ),
    ),
  ],
)

Alternatives

Packages that do the same job and could replace card_game.

Works with

Packages commonly used together with card_game: ones it builds on, ones built on it, and its own family.