flutter_chess_board 0.9.4

  • Readme
  • Changelog
  • Example
  • Installing
  • 80

flutter_chess_board #

A Chessboard Widget for Flutter. The widget maintains game state and gives callbacks for game events like moves, checkmate and draws. Under final testing before 1.0.

alt text

alt text

alt text

Import the package #

To use this package, add chess_board as a dependency in your pubspec.yaml

Example #

    import 'package:flutter/material.dart';
    import 'package:flutter_chess_board/flutter_chess_board.dart';
    void main() {
        new MaterialApp(
          home: new Scaffold(
            body: new Center(
              child: ChessBoard(
                size: 200.0,
                onMove: (move) {
                onCheckMate: (color) {
                onDraw: () {

Board parameters: #

size: #

Gives length and width of chess board

boardType: #

Type of board to display (Brown, Green, etc.)

onMove: #

Callback for when a move is made. Returns a move as a string. E.g.: "Nf4"

onDraw: #

Callback for when game becomes a draw.

onCheckMate: #

Callback for when a player checkmates the other. Returns the color of the winner.

whiteSideTowardsUser: #

Defines if white or black side faces user. The player is white by default(true). If set to false, black faces the user.

controller #

Defines the ChessBoardController for the widget for changing the board programmatically.

enableUserMoves #

Disables user moves when set to false.

Getting Started #

For help getting started with Flutter, view our online documentation.

For help on editing package code, view the documentation.

[0.9.4] - 06/02/2019. #

  • Changed sdk dependencies
  • Added board colors
  • Changed architecture to ScopedModel
  • Fixed controller bug
  • Added screenshots


import 'package:flutter/material.dart';
import 'package:flutter_chess_board/src/chess_board.dart';

void main() => runApp(new MyApp());

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  Widget build(BuildContext context) {
    return new MaterialApp(
      title: 'Flutter Demo',
      theme: new ThemeData(
        primarySwatch: Colors.blue,
      home: new MyHomePage(),

class MyHomePage extends StatefulWidget {
  _MyHomePageState createState() => new _MyHomePageState();

class _MyHomePageState extends State<MyHomePage> {
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
              onMove: (move) {
              onCheckMate: (color) {
              onDraw: () {},
              size: MediaQuery.of(context).size.width,
              enableUserMoves: true,

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  flutter_chess_board: ^0.9.4

2. Install it

You can install packages from the command line:

with Flutter:

$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:flutter_chess_board/flutter_chess_board.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on May 24, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.1
  • pana: 0.13.8-dev
  • Flutter: 1.17.0

Maintenance suggestions

Package is getting outdated. (-29.32 points)

The package was last published 67 weeks ago.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >2.0.0 <3.0.0
chess >=0.6.5 <1.0.0 0.6.5
chess_vectors_flutter >=1.0.6 <2.0.0 1.0.12
flutter 0.0.0
scoped_model >=1.0.0 <2.0.0 1.0.1
Transitive dependencies
collection 1.14.12
matcher 0.12.6
meta 1.1.8
path 1.7.0
quiver 2.1.3
sky_engine 0.0.99
stack_trace 1.9.3
tuple 1.0.3
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies