implemented basic chat bubbles generated from a list.

This commit is contained in:
Joshua
2024-07-07 16:44:08 -06:00
parent 80f20e73a9
commit 8956ed7885
11 changed files with 126 additions and 48 deletions
@@ -1,32 +1,34 @@
import '../conversation_bubbles/conversation_bubbles_model.dart';
import '/components/prompt_box/prompt_box_widget.dart';
import 'package:app/components/conversation_thread/chat_bubble_model.dart';
import 'package:app/components/conversation_thread/chat.dart';
import 'package:app/components/conversation_thread/conversation.dart';
import 'package:app/util/server.dart';
import 'package:app/components/prompt_box/prompt_box_widget.dart';
import 'package:flutterflow_ui/flutterflow_ui.dart';
import 'conversation_thread_widget.dart' show ConversationThreadWidget;
import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:provider/provider.dart';
import 'package:cached_network_image/cached_network_image.dart';
class ConversationThreadModel
extends FlutterFlowModel<ConversationThreadWidget> {
/// State fields for stateful widgets in this component.
class ConversationThreadModel extends FlutterFlowModel<ConversationThreadWidget> {
final formKey = GlobalKey<FormState>();
// Model for ConversationBubbles component.
late ConversationBubblesModel conversationBubblesModel;
// Model for PromptBox component.
late PromptBoxModel promptBoxModel;
late int ?conversationID;
late Conversation conversation;
// If there's a conversation ID, retrieve the conversation history.
// Otherwise, start a new conversation with user defaults.
ConversationThreadModel(this.conversationID);
@override
void initState(BuildContext context) {
//conversationBubblesModel = createModel(context, () => ConversationBubblesModel());
conversation = Conversation(conversationID!);
promptBoxModel = createModel(context, () => PromptBoxModel());
}
@override
void dispose() {
//conversationBubblesModel.dispose();
promptBoxModel.dispose();
}
}