chess_vectors_flutter 1.1.0 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.
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),
],
),
],
)));
}
}