generated from me/template-mit
Make the game board its own widget.
This commit is contained in:
@@ -9,9 +9,16 @@ 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(
|
}
|
||||||
|
|
||||||
|
class GameBoard extends StatelessWidget {
|
||||||
|
const GameBoard({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||||
children: [
|
children: [
|
||||||
@@ -52,8 +59,6 @@ class MainApp extends StatelessWidget {
|
|||||||
// Player 2 Goal
|
// Player 2 Goal
|
||||||
Column(children: [Center(child: Text(" P2 "))]),
|
Column(children: [Center(child: Text(" P2 "))]),
|
||||||
],
|
],
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user