From df9c2dc9c9681f77b916d80920ed776676279304 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Mon, 4 May 2026 16:59:34 -0700 Subject: [PATCH] Got a good looking layout now! --- lib/main.dart | 33 +++++++++++++++++++++++++-------- 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index 3c2eb02..e4fadeb 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -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); } }