ui: (Kinda) make the last message text work

This commit is contained in:
2021-12-23 17:19:24 +01:00
parent dae1b1d178
commit 262cf685b7
8 changed files with 32 additions and 9 deletions

View File

@@ -88,17 +88,19 @@ class _ConversationPageState extends State<ConversationPage> {
var args = ModalRoute.of(context)!.settings.arguments as ConversationPageArguments;
Conversation conversation = GetIt.I.get<ConversationRepository>().getConversation(args.jid)!;
String jid = conversation.jid;
return StoreConnector<MoxxyState, _MessageListViewModel>(
converter: (store) => _MessageListViewModel(
// TODO
messages: store.state.messages.containsKey("") ? store.state.messages[""]! : [],
messages: store.state.messages.containsKey(jid) ? store.state.messages[jid]! : [],
sendMessage: (body) => store.dispatch(
// TODO
AddMessageAction(
from: "UwU",
timestamp: "12:00",
body: body,
jid: jid
)
)
),

View File

@@ -25,6 +25,8 @@ class NewConversationPage extends StatelessWidget {
if (conversation == null) {
// TODO
// TODO: Install a middleware to make sure that the conversation gets added to the
// repository. Also handle updates
conversation = Conversation(
title: jid,
jid: jid,

View File

@@ -40,6 +40,7 @@ class ConversationsListRow extends StatelessWidget {
this.name,
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 17),
),
// TODO: Change color, font size and truncate the text when too long
Text(this.lastMessageBody)
]
)