feat: add message feature
This commit is contained in:
@@ -16,6 +16,7 @@ import '../../../wallet/presentation/bloc/wallet_status.dart';
|
||||
import '../../domain/entities/game_entities.dart';
|
||||
import '../bloc/game_bloc.dart';
|
||||
import '../bloc/game_state.dart';
|
||||
import '../widgets/chat_sheet.dart';
|
||||
import '../widgets/flame/hokm_game.dart';
|
||||
import '../widgets/table_hud.dart';
|
||||
|
||||
@@ -118,14 +119,9 @@ class _GameScreenState extends State<GameScreen> {
|
||||
TableHud(
|
||||
s: state.state!,
|
||||
connection: state.connection,
|
||||
chatBubbles: state.chatBubbles,
|
||||
onExit: () => _confirmLeave(context),
|
||||
onChat:
|
||||
() => ScaffoldMessenger.of(context).showSnackBar(
|
||||
const SnackBar(
|
||||
content: Text('گفتگو بهزودی'),
|
||||
duration: Duration(seconds: 1),
|
||||
),
|
||||
),
|
||||
onChat: () => _openChat(context),
|
||||
),
|
||||
if (state.connection == WsStatus.disconnected) _connBanner(),
|
||||
if (_showSearch(state)) _searchPanel(state),
|
||||
@@ -156,6 +152,15 @@ class _GameScreenState extends State<GameScreen> {
|
||||
);
|
||||
}
|
||||
|
||||
void _openChat(BuildContext context) {
|
||||
final bloc = context.read<GameBloc>();
|
||||
ChatSheet.show(
|
||||
context,
|
||||
onText: bloc.sendChatText,
|
||||
onEmoji: bloc.sendChatEmoji,
|
||||
);
|
||||
}
|
||||
|
||||
bool _isMyPlayTurn(GameUiState s) =>
|
||||
s.state != null &&
|
||||
s.gameOver == null &&
|
||||
|
||||
Reference in New Issue
Block a user