generated from me/template-mit
Change to using sized boxes to make all the spacing even.
This commit is contained in:
@@ -18,47 +18,64 @@ class GameBoard extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
var text = "hello test lalala";
|
||||||
return Row(
|
return Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
// Player 1 Goal
|
// Player 1 Goal
|
||||||
Column(children: [Center(child: Text(" P1 "))]),
|
Column(
|
||||||
|
children: [Center(child: BoardSpot(text: "P1"))],
|
||||||
|
),
|
||||||
// Center holes
|
// Center holes
|
||||||
Column(
|
Column(
|
||||||
spacing: 2,
|
spacing: 2,
|
||||||
children: [
|
children: [
|
||||||
Row(
|
Row(
|
||||||
spacing: 2,
|
spacing: 2,
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
Column(children: [Text(" 0,0 ")]),
|
Column(children: [BoardSpot(text: "0,0")]),
|
||||||
Column(children: [Text(" 1,0 ")]),
|
Column(children: [BoardSpot(text: "1,0")]),
|
||||||
Column(children: [Text(" 2,0 ")]),
|
Column(children: [BoardSpot(text: "2,0")]),
|
||||||
Column(children: [Text(" 3,0 ")]),
|
Column(children: [BoardSpot(text: "3,0")]),
|
||||||
Column(children: [Text(" 4,0 ")]),
|
Column(children: [BoardSpot(text: "4,0")]),
|
||||||
Column(children: [Text(" 5,0 ")]),
|
Column(children: [BoardSpot(text: "5,0")]),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
Row(
|
Row(
|
||||||
spacing: 2,
|
spacing: 2,
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
Column(children: [Text(" 0,1 ")]),
|
Column(children: [BoardSpot(text: "0,1")]),
|
||||||
Column(children: [Text(" 1,1 ")]),
|
Column(children: [BoardSpot(text: "1,1")]),
|
||||||
Column(children: [Text(" 2,1 ")]),
|
Column(children: [BoardSpot(text: "2,1")]),
|
||||||
Column(children: [Text(" 3,1 ")]),
|
Column(children: [BoardSpot(text: "3,1")]),
|
||||||
Column(children: [Text(" 4,1 ")]),
|
Column(children: [BoardSpot(text: "4,1")]),
|
||||||
Column(children: [Text(" 5,1 ")]),
|
Column(children: [BoardSpot(text: "5,1")]),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
BoardSpot(text: text),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
// Player 2 Goal
|
// Player 2 Goal
|
||||||
Column(children: [Center(child: Text(" P2 "))]),
|
Column(
|
||||||
|
children: [Center(child: BoardSpot(text: "P2"))],
|
||||||
|
),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class BoardSpot extends StatelessWidget {
|
||||||
|
const BoardSpot({super.key, required this.text});
|
||||||
|
|
||||||
|
final String text;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return SizedBox(width: 25.0, height: 25.0, child: Text(text));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user