fixed minor bug

This commit is contained in:
tom.hempel
2025-09-30 18:37:34 +02:00
parent 72421f36f2
commit c7f2a01f13
2 changed files with 19 additions and 31 deletions

Binary file not shown.

View File

@ -1,5 +1,4 @@
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:ai_chat_lab/services/convai_service.dart';
import 'package:ai_chat_lab/services/storage_service.dart';
import 'package:ai_chat_lab/screens/settings_screen.dart';
@ -487,21 +486,10 @@ class _ChatScreenState extends State<ChatScreen> {
)
else ...[
Expanded(
child: KeyboardListener(
focusNode: FocusNode(),
onKeyEvent: (KeyEvent event) {
if (event is KeyDownEvent) {
if (event.logicalKey == LogicalKeyboardKey.enter) {
if (!HardwareKeyboard.instance.isShiftPressed) {
_sendMessage();
}
}
}
},
child: TextField(
controller: _messageController,
decoration: InputDecoration(
hintText: 'Type your message... (Enter to send, Shift+Enter for new line)',
hintText: 'Type your message...',
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(24),
borderSide: const BorderSide(color: Color(0xFFCBD5E1)),
@ -514,11 +502,11 @@ class _ChatScreenState extends State<ChatScreen> {
filled: true,
fillColor: Colors.white,
),
keyboardType: TextInputType.multiline,
maxLines: null,
maxLines: 5,
minLines: 1,
textCapitalization: TextCapitalization.sentences,
),
textInputAction: TextInputAction.send,
onSubmitted: (_) => _sendMessage(),
),
),
const SizedBox(width: 8),