From 0356268b3286ecc924599fea71036116684093a2 Mon Sep 17 00:00:00 2001 From: Marco Date: Thu, 22 Dec 2022 00:00:35 +0100 Subject: [PATCH] Only show turn indicator and server output when in debug mode. --- lib/chessapp/chess_app.dart | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/lib/chessapp/chess_app.dart b/lib/chessapp/chess_app.dart index 3b85172..a77f22e 100644 --- a/lib/chessapp/chess_app.dart +++ b/lib/chessapp/chess_app.dart @@ -1,3 +1,4 @@ +import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:mchess/chess_bloc/chess_bloc.dart'; @@ -19,7 +20,7 @@ class ChessApp extends StatelessWidget { child: BlocProvider( create: (_) => ChessBloc.getInstance(), child: MaterialApp( - title: 'mChess v0.1.20', + title: 'mChess v0.1.1337', home: Scaffold( body: Container( decoration: const BoxDecoration( @@ -38,15 +39,16 @@ class ChessApp extends StatelessWidget { fit: BoxFit.contain, child: Row( children: [ - StreamBuilder( - stream: ServerConnection.getInstance().broadcast, - builder: (context, snapshot) { - return ServerLogWidget( - snapshot.data ?? "", - textColor: Colors.white, - ); - }, - ), + if (kDebugMode) + StreamBuilder( + stream: ServerConnection.getInstance().broadcast, + builder: (context, snapshot) { + return ServerLogWidget( + snapshot.data ?? "", + textColor: Colors.white, + ); + }, + ), Container( margin: const EdgeInsets.all(20), child: BlocBuilder( @@ -57,7 +59,7 @@ class ChessApp extends StatelessWidget { }, ), ), - const TurnIndicator(), + if (kDebugMode) const TurnIndicator(), ], ), )),