removed useless container and sendOnEnter

This commit is contained in:
NicKoehler 2023-06-08 12:51:13 +02:00
parent 4e00945a5d
commit 92fada0c8e
No known key found for this signature in database
GPG Key ID: 0EC502B679A11DD1

View File

@ -50,13 +50,7 @@ class ChatPage extends StatelessWidget implements PageShape {
child: Consumer<ChatModel>(
builder: (context, chatModel, child) {
final currentUser = chatModel.currentUser;
return Container(
padding: EdgeInsets.symmetric(vertical: 5.0),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10.0),
color: Theme.of(context).colorScheme.background,
),
child: Stack(
return Stack(
children: [
LayoutBuilder(builder: (context, constraints) {
final chat = DashChat(
@ -65,16 +59,14 @@ class ChatPage extends StatelessWidget implements PageShape {
chatModel.inputNode.requestFocus();
},
currentUser: chatModel.me,
messages: chatModel
.messages[chatModel.currentID]?.chatMessages ??
messages:
chatModel.messages[chatModel.currentID]?.chatMessages ??
[],
inputOptions: InputOptions(
sendOnEnter: true,
focusNode: chatModel.inputNode,
inputTextStyle: TextStyle(
fontSize: 14,
color:
Theme.of(context).textTheme.titleLarge?.color),
color: Theme.of(context).textTheme.titleLarge?.color),
inputDecoration: InputDecoration(
isDense: true,
hintText: translate('Write a message'),
@ -123,7 +115,6 @@ class ChatPage extends StatelessWidget implements PageShape {
messageDecorationBuilder:
(message, previousMessage, nextMessage) {
final isOwnMessage = message.user.id.isBlank!;
print("message.user.id = ${message.user.id}\n");
return defaultMessageDecoration(
color:
isOwnMessage ? MyTheme.accent : Colors.blueGrey,
@ -144,8 +135,7 @@ class ChatPage extends StatelessWidget implements PageShape {
padding: EdgeInsets.all(12),
child: Row(
children: [
Icon(Icons.account_circle,
color: MyTheme.accent80),
Icon(Icons.account_circle, color: MyTheme.accent80),
SizedBox(width: 5),
Text(
"${currentUser.firstName} ${currentUser.id}",
@ -155,8 +145,7 @@ class ChatPage extends StatelessWidget implements PageShape {
),
),
],
),
);
).paddingOnly(bottom: 8);
},
),
),