dynamic chat bubbles implemented along with conversation support. currently only hard-coded dummy data.

This commit is contained in:
Joshua
2024-07-08 19:48:14 -06:00
parent 7547fe110f
commit 78e7f4b896
11 changed files with 308 additions and 259 deletions
@@ -1,15 +1,40 @@
import 'package:app/util/server.dart';
import 'package:flutter/material.dart';
import 'chat.dart';
class Conversation {
class Conversation with ChangeNotifier {
int conversationID;
String conversationLabel;
String conversationSubLabel;
List<Chat> chats = [];
Conversation(this.conversationID) {
chats = Server().getConversationByID(conversationID);
Conversation(this.conversationID, this.conversationLabel, this.conversationSubLabel);
Conversation.completeConversation(this.conversationID, this.conversationLabel, this.conversationSubLabel, this.chats);
void add(Chat message) {
chats.add(message);
notifyListeners();
}
void loadChats() {
chats = Server.getChatsByConversationID(conversationID);
}
void setLabel() {
// TODO: Need to implement
}
void setSubLabel() {
// TODO: Need to implement
}
List<Chat> getChats() {
return chats;
}
void setLabels(String cLabel, String cSubLabel) {
conversationLabel = cLabel;
conversationSubLabel = cSubLabel;
}
}