deven98 / flutter_chess_board Goto Github PK
View Code? Open in Web Editor NEWA Chessboard widget for Flutter.
License: BSD 2-Clause "Simplified" License
A Chessboard widget for Flutter.
License: BSD 2-Clause "Simplified" License
Draggable doesn't go to the new DragTarget when accepted, it returns to where it was. Any idea why?
Would be a lot appreciated the adding of a feature that allows players to draw arrows in the board
In current version makeMove methods doesn't return anything.
It could be useful to propagate information from game.move to the caller if move was accepted or rejected.
Use cases:
Instead return bool, raising some exception will be also good (However I would recommend to keep chess.move consistency )
My goal was trying to create a dynamic list of BoardArrow that can be changed at each user move.
The problem is after I use setState with BoardArrow list, the 'ChessBoard' widget is going to be reset with the initial position.
The process were;
Add next() back() functions in ChessBoardController.
There are 2 closed same issues, but none is commented/ explained, so I hope this one will be helpful
loadPGN() doesn't seem to work with PGN files that include annotations and/or move arrows/circles.
Hi, can you add the method controller.move() e.x controller.move('Nf3') ? Currently, there is only makeMove which takes two strings (from: , to: ) ,but this is not very used in chess notations. To create a viewer to reproduce games from pgn files it will be easier, plus it's just two lines of code :)
When using the following code, all pieces are shown as white pawns.
https://ibb.co/5kJzF1Y
import 'package:flutter/material.dart';
import 'package:flutter_chess_board/flutter_chess_board.dart';
void main() => runApp(new MyApp());
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return new MaterialApp(
title: 'Flutter Demo',
theme: new ThemeData(
primarySwatch: Colors.blue,
),
home: new MyHomePage(),
);
}
}
class MyHomePage extends StatefulWidget {
@override
_MyHomePageState createState() => new _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
ChessBoard(
onMove: (move) {
print(move);
},
onCheckMate: (color) {
print(color);
},
onDraw: () {},
size: MediaQuery.of(context).size.width,
enableUserMoves: true,
)
],
),
),
);
}
}
I am using flutter_chess_board 0.9.4.
Castling is not working in the package
The Flutter project currently contains deprecated usages of onWillAccept and onAccept callbacks within the DragTarget widget. These callbacks have been deprecated after version v3.14.0-0.2.pre and should be replaced with their updated counterparts onWillAcceptWithDetails and onAcceptWithDetails.
When I flip board the board is reset
The board resets after setState() is called in the middle of a game.
Because chess depends on flutter_chess_board ^0.9.4 which depends on chess >=0.6.5 <1.0.0, chess >=0.6.5 <1.0.0 is required.
So, because chess is 1.0.0+1, version solving failed.
pub get failed (1; So, because chess is 1.0.0+1, version solving failed.)
When a promotion happens, the onMove
event doesn't fire.
I suspect this is because of line 50 in file lib/src/board_square.dart
scholar's mate will not call the listener
Adding animation effect of drag and drop while colouring the possible dropping squares of the dragged piece will be awesome.
It can be a feature that gets enabled or disabled by properties of the widget.
It would be great to extend move family methods and support UCI format as an input format for move.
E.g.
makeMoveWithUCI
getHistory could also return moves with some easy possiblity of transforming them to UCI
e.g.
getHistoryInUci
I need help with check event.
How to know if the player got check or not?
I didn't see anything regarding that. In older version there was a onCheck event.
Hello,
Great plugin! Do you plan to make the plugin support the Null Safety language feature anytime soon?
Thanks for your answer.
Is there an option to show the markings on the chess board like so - https://en.wikipedia.org/wiki/File:SCD_algebraic_notation.svg? If not, can it be added?
Hello, it will be great if you can also add the sound of move
Is it possible to set the board with a specific fen? Would be a great improvement.
Hey can you tell me how to use undoMove functionality propperly or provide a code snippet .I have tried the following but it's not working
IconButton(
icon: Icon(Icons.undo_outlined),
onPressed: () {
controller.undoMove();
},
),
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.