Only show turn indicator and server output when in debug mode.

This commit is contained in:
Marco 2022-12-22 00:00:35 +01:00
parent 0b7c3897e5
commit 0356268b32

View File

@ -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 ?? "<snapshot empty>",
textColor: Colors.white,
);
},
),
if (kDebugMode)
StreamBuilder(
stream: ServerConnection.getInstance().broadcast,
builder: (context, snapshot) {
return ServerLogWidget(
snapshot.data ?? "<snapshot empty>",
textColor: Colors.white,
);
},
),
Container(
margin: const EdgeInsets.all(20),
child: BlocBuilder<ChessBloc, ChessBoardState>(
@ -57,7 +59,7 @@ class ChessApp extends StatelessWidget {
},
),
),
const TurnIndicator(),
if (kDebugMode) const TurnIndicator(),
],
),
)),