Got a good looking layout now!

This commit is contained in:
2026-05-04 16:59:34 -07:00
parent c946e9a003
commit df9c2dc9c9

View File

@@ -25,14 +25,14 @@ class GameBoard extends StatelessWidget {
children: [
// Player 1 Goal
Column(
children: [Center(child: BoardSpot(text: "P1"))],
children: [Center(child: PlayerHole(text: "P1"))],
),
// Center holes
Column(
spacing: 2,
//spacing: 2,
children: [
Row(
spacing: 2,
//spacing: 2,
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
@@ -45,7 +45,7 @@ class GameBoard extends StatelessWidget {
],
),
Row(
spacing: 2,
//spacing: 2,
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
@@ -62,7 +62,7 @@ class GameBoard extends StatelessWidget {
),
// Player 2 Goal
Column(
children: [Center(child: BoardSpot(text: "P2"))],
children: [Center(child: PlayerHole(text: "P2"))],
),
],
);
@@ -70,12 +70,29 @@ class GameBoard extends StatelessWidget {
}
class BoardSpot extends StatelessWidget {
const BoardSpot({super.key, required this.text});
final String text;
final double w;
final double h;
BoardSpot({super.key, required this.text, this.w = 50, this.h = 50});
@override
Widget build(BuildContext context) {
return SizedBox(width: 25.0, height: 25.0, child: Text(text));
return SizedBox(
width: w,
height: h,
child: Center(child: Text(text, textAlign: TextAlign.center)),
);
}
}
class PlayerHole extends StatelessWidget {
final String text;
PlayerHole({super.key, required this.text});
@override
Widget build(BuildContext context) {
return BoardSpot(w: 50, h: 100, text: text);
}
}