flutter_chessboard_js 0.0.1+6 copy "flutter_chessboard_js: ^0.0.1+6" to clipboard
flutter_chessboard_js: ^0.0.1+6 copied to clipboard

discontinued
outdated

A chessboard widget to use with chessjs. Use chessjs for the logic of the game, and this package to display the game.

example/main.dart

import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:chessjs/chessjs.dart' as chessjs;
import 'package:flutter_chessboard_js/flutter_chessboard.dart' as chessboard;

void main() {
  runApp(MyApp());
}

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

class ChessGame extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    final chessboard.ChessboardController controller =
        chessboard.ChessboardController(chessjsGame: chessjs.Chess());

    return Scaffold(
      backgroundColor: Colors.black,
      body: SizedBox.expand(
        child: Theme(
          data: ThemeData.dark(),
          child: Row(
            children: [
              chessboard.ChessBoard(
                initialSize: 400,
                minSize: 300,
                controller: controller,
              ),
            ],
          ),
        ),
      ),
    );
  }
}
1
likes
0
pub points
0%
popularity

Publisher

verified publishercarlosalejano.app

A chessboard widget to use with chessjs. Use chessjs for the logic of the game, and this package to display the game.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

chessjs, flutter, tuple

More

Packages that depend on flutter_chessboard_js