db: FINALLY ADD A DATABASE

This commit is contained in:
2021-12-28 16:30:10 +01:00
parent 3448a03c36
commit c38770d68f
15 changed files with 288 additions and 123 deletions

View File

@@ -164,22 +164,26 @@ class ConversationPage extends StatelessWidget {
double maxWidth = MediaQuery.of(context).size.width * 0.6;
return StoreConnector<MoxxyState, _MessageListViewModel>(
converter: (store) => _MessageListViewModel(
conversation: store.state.conversations.firstWhere((item) => item.jid == jid),
showSendButton: store.state.conversationPageState.showSendButton,
setShowSendButton: (show) => store.dispatch(SetShowSendButtonAction(show: show)),
showScrollToEndButton: store.state.conversationPageState.showScrollToEndButton,
setShowScrollToEndButton: (show) => store.dispatch(SetShowScrollToEndButtonAction(show: show)),
sendMessage: (body) => store.dispatch(
// TODO
AddMessageAction(
from: "UwU",
timestamp: DateTime.now().millisecondsSinceEpoch,
body: body,
jid: jid
converter: (store) {
Conversation conversation = store.state.conversations.firstWhere((item) => item.jid == jid);
return _MessageListViewModel(
conversation: conversation,
showSendButton: store.state.conversationPageState.showSendButton,
setShowSendButton: (show) => store.dispatch(SetShowSendButtonAction(show: show)),
showScrollToEndButton: store.state.conversationPageState.showScrollToEndButton,
setShowScrollToEndButton: (show) => store.dispatch(SetShowScrollToEndButtonAction(show: show)),
sendMessage: (body) => store.dispatch(
// TODO
AddMessageAction(
from: "UwU",
timestamp: DateTime.now().millisecondsSinceEpoch,
body: body,
jid: jid,
cid: conversation.id
)
)
)
),
);
},
builder: (context, viewModel) {
return Scaffold(
appBar: BorderlessTopbar.avatarAndName(