Skip to content
pubscout

chess

0.8.1, released 3 years ago by oaksnow.com

Library for generating legal chess moves, tracking game state, and converting between FEN/PGN.

WASM-ready
$ flutter pub add chess
Source repository

What it does

Provides a pure Dart implementation of chess move generation, game state maintenance, and FEN/PGN conversion. It has no external dependencies and supports null safety.

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

Use it when

  • Implement chess logic in a Dart app
  • Create a chess engine or AI
  • Need FEN/PGN parsing or validation

Skip it when

  • You need a ready‑made UI board widget

Strengths

  • No external dependencies
  • Null safety and modern Dart support
  • Comprehensive test suite and performance improvements

Weaknesses

  • No UI components
  • Limited to logic only

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
0
import 'package:chess/chess.dart';

void main() {
  Chess chess = Chess();
  while (!chess.gameOver) {
    print('position: ' + chess.fen);
    var moves = chess.moves();
    moves.shuffle();
    chess.move(moves.first);
  }
}

Alternatives

Packages that do the same job and could replace chess.

  • dartchess

    A Dart library for chess rules, move generation, and FEN/PGN parsing with variant support.

Works with

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