chess_board_widget

Creator: coderz1093

Last updated:

0 purchases

chess_board_widget Image
chess_board_widget Images

Languages

Categories

Add to Cart

Description:

chess board widget

chess_board #
This package is for drawing styled chess boards. Default styles are provided, which resemble lichess boards, but the style can also be easily overridden. For a better user experience, niceties are provided like piece movement animations and square decorations. This package uses the chess_lib package for handling the modelling of chess and its rules.

Getting started #
To import:
import 'package:chess_board_widget/chess_board_widget.dart';
copied to clipboard
An example usage is as follows:
class ExampleUsage extends StatefulWidget {
const ExampleUsage({Key? key}) : super(key: key);

@override
State<ExampleUsage> createState() => ExampleUsageState();
}

class ExampleUsageState extends State<ExampleUsage> {
ChessGameState state = ChessGameState.initialBoardPosition();

@override
Widget build(BuildContext context) {
return Scaffold(
body: ChessBoardWidget(
state: state,
onPlayMove: (move) {
setState(() {
state = state.playMove(move);
});
},
),
);
}
}
copied to clipboard

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.