chess_vectors_flutter 1.1.0 copy "chess_vectors_flutter: ^1.1.0" to clipboard
chess_vectors_flutter: ^1.1.0 copied to clipboard

Chess pieces vectors for Flutter. These vectors are custom widgets based on original SVG from Wikimedia Commons.

example/example.dart

import '../lib/chess_vectors_flutter.dart'; // adapt import
import 'package:flutter/material.dart';

void main() => runApp(new MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return new MaterialApp(
      title: 'Flutter Demo',
      theme: new ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: new MyHomePage(),
    );
  }
}

class MyHomePage extends StatelessWidget {
  MyHomePage({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    const commonSize = 50.0;
    return new Scaffold(
        appBar: new AppBar(
          title: new Text('Chess vectors experiment'),
          backgroundColor: Colors.blue,
        ),
        body: Container(
            decoration: BoxDecoration(
              color: Colors.green,
            ),
            child: Column(
              children: <Widget>[
                Row(
                  children: <Widget>[
                    WhitePawn(
                      size: commonSize,
                      // You can also change fill color .
                      fillColor: Colors.blue,

                      // You can also change stroke color .
                      strokeColor: Colors.red,
                    ),
                    WhiteKnight(size: commonSize),
                    WhiteBishop(size: commonSize),
                    WhiteRook(size: commonSize),
                    WhiteQueen(size: commonSize),
                    WhiteKing(size: commonSize),
                  ],
                ),
                Row(
                  children: <Widget>[
                    BlackPawn(size: commonSize),
                    BlackKnight(size: commonSize),
                    BlackBishop(size: commonSize),
                    BlackRook(size: commonSize),
                    BlackQueen(size: commonSize),
                    BlackKing(size: commonSize),
                  ],
                ),
              ],
            )));
  }
}
16
likes
150
points
528
downloads

Publisher

verified publisherpassion-programmation-laurentdu64.blogspot.com

Weekly Downloads

Chess pieces vectors for Flutter. These vectors are custom widgets based on original SVG from Wikimedia Commons.

Repository (GitHub)

Documentation

API reference

License

MIT (license)

Dependencies

flutter, tuple

More

Packages that depend on chess_vectors_flutter