mchess-client/lib/chess/turn_indicator_widget.dart

20 lines
549 B
Dart

import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:mchess/chess_bloc/chess_bloc.dart';
import '../utils/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),
),
);
}
}