chess_vectors_flutter 1.0.6 chess_vectors_flutter: ^1.0.6 copied to clipboard
Chess pieces vectors for Flutter. These vectors are custom widgets. They have their own size they can also be moved (position property) inside their parent, and be resize (size property).
// Replace the following import by 'package:chess_vectors_flutter.dart' in your project
import '../lib/chess_vectors_flutter.dart';
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)
],
),
Row(
children: <Widget>[
WhiteRook(position: Offset(20.0, 5.0), size: 60.0)
],
)
],
)));
}
}