generated from me/template-mit
Make the game board its own widget.
This commit is contained in:
@@ -9,51 +9,56 @@ class MainApp extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return const MaterialApp(
|
return const MaterialApp(home: Scaffold(body: GameBoard()));
|
||||||
home: Scaffold(
|
}
|
||||||
body: Row(
|
}
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
class GameBoard extends StatelessWidget {
|
||||||
|
const GameBoard({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||||
|
children: [
|
||||||
|
// Player 1 Goal
|
||||||
|
Column(children: [Center(child: Text(" P1 "))]),
|
||||||
|
// Center holes
|
||||||
|
Column(
|
||||||
|
spacing: 2,
|
||||||
children: [
|
children: [
|
||||||
// Player 1 Goal
|
Row(
|
||||||
Column(children: [Center(child: Text(" P1 "))]),
|
|
||||||
// Center holes
|
|
||||||
Column(
|
|
||||||
spacing: 2,
|
spacing: 2,
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||||
children: [
|
children: [
|
||||||
Row(
|
Column(children: [Text(" 0,0 ")]),
|
||||||
spacing: 2,
|
Column(children: [Text(" 1,0 ")]),
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
Column(children: [Text(" 2,0 ")]),
|
||||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
Column(children: [Text(" 3,0 ")]),
|
||||||
children: [
|
Column(children: [Text(" 4,0 ")]),
|
||||||
Column(children: [Text(" 0,0 ")]),
|
Column(children: [Text(" 5,0 ")]),
|
||||||
Column(children: [Text(" 1,0 ")]),
|
],
|
||||||
Column(children: [Text(" 2,0 ")]),
|
),
|
||||||
Column(children: [Text(" 3,0 ")]),
|
Row(
|
||||||
Column(children: [Text(" 4,0 ")]),
|
spacing: 2,
|
||||||
Column(children: [Text(" 5,0 ")]),
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||||
],
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||||
),
|
children: [
|
||||||
Row(
|
Column(children: [Text(" 0,1 ")]),
|
||||||
spacing: 2,
|
Column(children: [Text(" 1,1 ")]),
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
Column(children: [Text(" 2,1 ")]),
|
||||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
Column(children: [Text(" 3,1 ")]),
|
||||||
children: [
|
Column(children: [Text(" 4,1 ")]),
|
||||||
Column(children: [Text(" 0,1 ")]),
|
Column(children: [Text(" 5,1 ")]),
|
||||||
Column(children: [Text(" 1,1 ")]),
|
|
||||||
Column(children: [Text(" 2,1 ")]),
|
|
||||||
Column(children: [Text(" 3,1 ")]),
|
|
||||||
Column(children: [Text(" 4,1 ")]),
|
|
||||||
Column(children: [Text(" 5,1 ")]),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
// Player 2 Goal
|
|
||||||
Column(children: [Center(child: Text(" P2 "))]),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
// Player 2 Goal
|
||||||
|
Column(children: [Center(child: Text(" P2 "))]),
|
||||||
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user