implemented basic settings into the backend, renamed files, fixed bugs, and added back button functionality
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import 'package:app/util/server.dart';
|
||||
import 'package:app/util/backend.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'chat.dart';
|
||||
|
||||
@@ -6,19 +6,30 @@ class Conversation with ChangeNotifier {
|
||||
int conversationID;
|
||||
String conversationLabel;
|
||||
String conversationSubLabel;
|
||||
bool history = true;
|
||||
// History is disabled by default. This means chats are auto-deleted once the user exits that conversation.
|
||||
bool conversationContext = true; // The prior prompts and responses are used as additional context for the next prompt and response.
|
||||
late bool stream = false; // Update the UI with a stream of characters as received from the server, or as one text.
|
||||
List<Chat> chats = [];
|
||||
|
||||
Conversation(this.conversationID, this.conversationLabel, this.conversationSubLabel);
|
||||
|
||||
Conversation.completeConversation(this.conversationID, this.conversationLabel, this.conversationSubLabel, this.chats);
|
||||
|
||||
void toggleHistory() => history = !history;
|
||||
|
||||
void toggleConversationContext() => conversationContext = !conversationContext;
|
||||
|
||||
void toggleStream() => stream = !stream;
|
||||
|
||||
void add(Chat message) {
|
||||
chats.add(message);
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void loadChats() {
|
||||
chats = Backend.getChatsByConversationID(conversationID);
|
||||
Backend.loadConversation;
|
||||
chats = Backend.loadedChats;
|
||||
}
|
||||
|
||||
void setLabel() {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
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/util/backend.dart';
|
||||
|
||||
import 'package:app/components/prompt_box/prompt_box_widget.dart';
|
||||
import 'package:flutterflow_ui/flutterflow_ui.dart';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import 'package:app/components/conversation_thread/conversation.dart';
|
||||
import 'package:app/util/server.dart';
|
||||
import 'package:app/util/backend.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import '/components/conversation_thread/chat_bubble_widget.dart';
|
||||
|
||||
@@ -84,7 +84,7 @@ class _PopupWidgetState extends State<PopupWidget> {
|
||||
child: Padding(
|
||||
padding: EdgeInsetsDirectional.fromSTEB(0, 0, 12, 0),
|
||||
child: Text(
|
||||
'Refine the components modal.',
|
||||
'A popup',
|
||||
style: AppTheme.headlineMedium,
|
||||
),
|
||||
),
|
||||
@@ -106,12 +106,12 @@ class _PopupWidgetState extends State<PopupWidget> {
|
||||
],
|
||||
),
|
||||
const Divider(
|
||||
height: 24,
|
||||
height: 12,
|
||||
thickness: 2,
|
||||
color: Color(0xFFF1F4F8),
|
||||
),
|
||||
const Text(
|
||||
'FlutterFlow is a visual development platform that allows you to easily create beautiful and responsive user interfaces for your mobile and web applications. With its drag-and-drop interface and pre-built components, you can quickly prototype and build your app without writing any code. \nAdditionally, FlutterFlow\'s real-time preview feature allows you to see your changes in real-time and make adjustments on the fly.',
|
||||
'Test',
|
||||
style: AppTheme.labelMedium,
|
||||
),
|
||||
Padding(
|
||||
@@ -147,7 +147,7 @@ class _PopupWidgetState extends State<PopupWidget> {
|
||||
onPressed: () {
|
||||
print('Button pressed ...');
|
||||
},
|
||||
text: 'Create Task',
|
||||
text: 'Action',
|
||||
options: FFButtonOptions(
|
||||
width: 130,
|
||||
height: 40,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import 'package:app/util/server.dart';
|
||||
import 'package:app/util/backend.dart';
|
||||
import 'package:flutterflow_ui/flutterflow_ui.dart';
|
||||
import 'package:easy_debounce/easy_debounce.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
@@ -209,7 +209,8 @@ class _PromptBoxWidgetState extends State<PromptBoxWidget> {
|
||||
validator: _model.textControllerValidator.asValidator(context),
|
||||
textInputAction: TextInputAction.send, // "Send" on keyboard
|
||||
onFieldSubmitted: (text) {
|
||||
Backend.respondWhenReady(text); // TODO: Connect with multimedia
|
||||
entry_text = _model.textController.text;
|
||||
Backend.respondWhenReady(entry_text); // TODO: Connect with multimedia
|
||||
_model.textController?.clear(); // Clear the text field
|
||||
},
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user