From b329cb10adb8eb5633e7200b2c10aa56a87cb699 Mon Sep 17 00:00:00 2001 From: Marco Date: Sat, 19 Nov 2022 11:37:15 +0100 Subject: [PATCH] Make chessboard fit its window. --- lib/chessapp/chess_app.dart | 49 +++++++++++++++++++------------------ 1 file changed, 25 insertions(+), 24 deletions(-) diff --git a/lib/chessapp/chess_app.dart b/lib/chessapp/chess_app.dart index f949cb3..782ea43 100644 --- a/lib/chessapp/chess_app.dart +++ b/lib/chessapp/chess_app.dart @@ -26,34 +26,35 @@ class ChessApp extends StatelessWidget { ), ), child: Center( + child: FittedBox( + fit: BoxFit.contain, child: Column( - children: [ - FittedBox( - fit: BoxFit.contain, - child: Container( - margin: const EdgeInsets.all(20), - child: BlocProvider( - create: (_) => ChessBloc.getInstance(), - child: BlocBuilder( - builder: (context, state) { - return ChessBoard( - bState: state, - ); - }, + children: [ + Container( + margin: const EdgeInsets.all(20), + child: BlocProvider( + create: (_) => ChessBloc.getInstance(), + child: BlocBuilder( + builder: (context, state) { + return ChessBoard( + bState: state, + ); + }, + ), ), ), - ), + StreamBuilder( + stream: ServerConnection.getInstance().channel.stream, + builder: (context, snapshot) { + return Text( + style: const TextStyle(color: Colors.white), + snapshot.data.toString()); + }, + ) + ], ), - StreamBuilder( - stream: ServerConnection.getInstance().channel.stream, - builder: (context, snapshot) { - return Text( - style: const TextStyle(color: Colors.white), - snapshot.data.toString()); - }, - ) - ], - )), + ), + ), ), ), );