Giter VIP home page Giter VIP logo

flutter_chess_board's Introduction

flutter_chess_board's People

Contributors

deven98 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

flutter_chess_board's Issues

include method controller.move(move)

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 :)

Dynamic BoardArrow List

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;

  • Create a list of board arrow
    Cursor_and_chess-tactics_–_chess_board_view_dart-2

  • Assign board arrow list the to 'ChessBoard' widget that we're mainly using.
    Cursor_and_chess-tactics_–_chess_board_view_dart

  • After these steps we have two options which are adding new BoardArrow to the list and show in the 'ChessBoard' widget.
    Cursor_and_chess-tactics_–_chess_board_view_dart-3

  • Or we can clear the BoardArrow list after we've shown.
    chess-tactics_–_chess_board_view_dart

Sound on move

Hello, it will be great if you can also add the sound of move

Check Event

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.

castling

Castling is not working in the package

[Feature request] Add drag and drop animation

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.

Chessboard displays only the white pawn symbol

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.

makeMove with fedback about success or fail

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:

  • info for user that move was rejected on some status bar or other widget
  • chess engine development when engine is providing incorrect move

Instead return bool, raising some exception will be also good (However I would recommend to keep chess.move consistency )

Load game from fen

Is it possible to set the board with a specific fen? Would be a great improvement.

Null safety

Hello,
Great plugin! Do you plan to make the plugin support the Null Safety language feature anytime soon?
Thanks for your answer.

Small pieces during Drag & Drop in Desktop

Hi,

It is not a big thing but In Desktop (Windows) app moving piece is very small and moved from the cursor. The same code in Android works fine.

image

Best regards,
Wojciech

Support for UCI

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

undo Move

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();
},
),

Deprecated DragTarget Callbacks in Flutter Project

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.

onCheckMate not working

There are 2 closed same issues, but none is commented/ explained, so I hope this one will be helpful

dart 2 problem!

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.)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.