0 purchases
wp chessboard
WP_CHESSBOARD #
A very customizable Chessboard with awesomeness already onboard:
👇️ Dragable Pieces
🎬️ Move Animations
🔄 Orientation
💡 Hints
💡 Arrows
Features #
👇️ Dragable Pieces #
🎬️ Piece Animations for Single Moves #
🎬️ Piece Animations for position changes/reset #
🔄 Change Orientation #
💡 Display Hints #
💡 Display Arrows #
Usage #
First import the WPChessboard widget.
import 'package:wp_chessboard/wp_chessboard.dart';
copied to clipboard
Then, you are ready to use it
You can use your own piece set, in the example we will
use the chess_vectors_flutter package.
WPChessboard(
size: size,
orientation: orienatation,
squareBuilder: squareBuilder,
controller: controller,
// Dont pass any onPieceDrop handler to disable drag and drop
onPieceDrop: onPieceDrop,
onPieceTap: onPieceTap,
onPieceStartDrag: onPieceStartDrag,
onEmptyFieldTap: onEmptyFieldTap,
turnTopPlayerPieces: false,
ghostOnDrag: true,
dropIndicator: DropIndicatorArgs(
size: size / 2,
color: Colors.lightBlue.withOpacity(0.24)
),
pieceMap: PieceMap(
K: (size) => WhiteKing(size: size),
Q: (size) => WhiteQueen(size: size),
B: (size) => WhiteBishop(size: size),
N: (size) => WhiteKnight(size: size),
R: (size) => WhiteRook(size: size),
P: (size) => WhitePawn(size: size),
k: (size) => BlackKing(size: size),
q: (size) => BlackQueen(size: size),
b: (size) => BlackBishop(size: size),
n: (size) => BlackKnight(size: size),
r: (size) => BlackRook(size: size),
p: (size) => BlackPawn(size: size),
),
),
copied to clipboard
I know this is very short, for more information checkout the example :).
Additional information #
Every contribution is very welcome.
Cheers 🥂
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.