From 2a66f465ceff86844ed1b3ad9c35ac5ef906a718 Mon Sep 17 00:00:00 2001 From: Sens van Aert Date: Fri, 8 Dec 2023 13:06:43 +0100 Subject: [PATCH] Create new answer and go to next question --- code/mobileapp/lib/main.dart | 2 +- code/mobileapp/lib/pages/tree_home.dart | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/code/mobileapp/lib/main.dart b/code/mobileapp/lib/main.dart index 86eb75f..0ff28aa 100644 --- a/code/mobileapp/lib/main.dart +++ b/code/mobileapp/lib/main.dart @@ -14,7 +14,7 @@ void main() { runApp(MaterialApp( debugShowCheckedModeBanner: false, theme: ThemeData(fontFamily: 'Epilogue'), - initialRoute: "/testlottie", + initialRoute: "/home", routes: { '/login': (context) => const LoginPage(), '/infosegment': (context) => const InfoSegments(), diff --git a/code/mobileapp/lib/pages/tree_home.dart b/code/mobileapp/lib/pages/tree_home.dart index dd62700..b3e2c9e 100644 --- a/code/mobileapp/lib/pages/tree_home.dart +++ b/code/mobileapp/lib/pages/tree_home.dart @@ -88,8 +88,8 @@ class _TreeHomeState extends State { } Future reloadAllData() async { - print("REACHING FUNCTION!"); await _initializeData(); + isInputVisible = false; } @override @@ -321,7 +321,6 @@ class _InputBubbleState extends State { if (response.statusCode == 200) { print('Answer sent successfully'); - await widget.reloadData(); } else { print("Request failed with status: ${response.statusCode}"); throw Exception('Failed to send answer'); @@ -347,6 +346,7 @@ class _InputBubbleState extends State { if (response.statusCode == 200) { print('Answer sent successfully'); + widget.reloadData(); } else { print("Request failed with status: ${response.statusCode}"); throw Exception('Failed to send answer'); @@ -385,8 +385,6 @@ class _InputBubbleState extends State { onPressed: () { // Handle sending the message final newAnswer = _textController.text; - print("Sending message: $newAnswer"); - _sendAnswer(newAnswer); }, ),