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: [ children: [
// Player 1 Goal // Player 1 Goal
Column( Column(
children: [Center(child: BoardSpot(text: "P1"))], children: [Center(child: PlayerHole(text: "P1"))],
), ),
// Center holes // Center holes
Column( Column(
spacing: 2, //spacing: 2,
children: [ children: [
Row( Row(
spacing: 2, //spacing: 2,
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
@@ -45,7 +45,7 @@ class GameBoard extends StatelessWidget {
], ],
), ),
Row( Row(
spacing: 2, //spacing: 2,
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
@@ -62,7 +62,7 @@ class GameBoard extends StatelessWidget {
), ),
// Player 2 Goal // Player 2 Goal
Column( 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 { class BoardSpot extends StatelessWidget {
const BoardSpot({super.key, required this.text});
final String text; final String text;
final double w;
final double h;
BoardSpot({super.key, required this.text, this.w = 50, this.h = 50});
@override @override
Widget build(BuildContext context) { 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);
} }
} }