chess_vectors_flutter 1.0.10

  • Readme
  • Changelog
  • Example
  • Installing
  • 87

chess vectors flutter #

Chess pieces vectors for Flutter. These vectors are custom widgets based on Wikimedia commons Svg. You can customize the size.

Getting Started #

Add whatever piece widget you want to your components tree :

  • size property takes a double value for defining the piece side size (same width and height).

CREDITS #

This project is using the SVG definitions of Chess pieces from a Wikimedia Commons page

[1.0.10] - 01/07/2019.

  • More compliant to DartPub specification.

[1.0.8] - 30/06/2019.

  • Removed the offset property : one has to use Flutter Padding/Center/... widgets to achieve the same effects.

[1.0.6] - 08/09/2018.

  • Improved library for publishing on Dart Pub.

[1.0.4] - 08/09/2018.

  • Adapted library in order to be accepted by Dart 2.

[1.0.0] - 08/08/2018.

  • Initial release : all pieces widgets can be directly integrated into your components tree, can be moved and/or resized.

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.red,
            ),
            child: Column(
              children: <Widget>[
                Row(
                  children: <Widget>[
                    WhitePawn(size: commonSize),
                    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)
                  ],
                ),
              ],
            )));
  }
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  chess_vectors_flutter: ^1.0.10

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:chess_vectors_flutter/chess_vectors_flutter.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
73
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
87
Learn more about scoring.

We analyzed this package on Nov 15, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.6.0
  • pana: 0.12.21
  • Flutter: 1.9.1+hotfix.6

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
tuple ^1.0.2 1.0.3
Transitive dependencies
collection 1.14.11 1.14.12
matcher 0.12.6
meta 1.1.7 1.1.8
path 1.6.4
quiver 2.1.2+1
sky_engine 0.0.99
stack_trace 1.9.3
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test