mchess-client/lib/chessapp/turn_indicator_widget.dart

20 lines
540 B
Dart
Raw Normal View History

2022-12-18 00:04:08 +00:00
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:mchess/chess_bloc/chess_bloc.dart';
import 'chess_utils.dart';
class TurnIndicator extends StatelessWidget {
const TurnIndicator({super.key});
@override
Widget build(BuildContext context) {
return BlocBuilder<ChessBloc, ChessBoardState>(
builder: (context, state) => Text(
state.newTurnColor == ChessColor.white ? "white" : "black",
style: const TextStyle(color: Colors.white),
),
);
}
}