dynamic chat bubbles implemented along with conversation support. currently only hard-coded dummy data.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user