Skip to content

Commit

Permalink
Create new answer and go to next question
Browse files Browse the repository at this point in the history
  • Loading branch information
SensvanAert committed Dec 8, 2023
1 parent 7e42d81 commit 2a66f46
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion code/mobileapp/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
6 changes: 2 additions & 4 deletions code/mobileapp/lib/pages/tree_home.dart
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ class _TreeHomeState extends State<TreeHome> {
}

Future<void> reloadAllData() async {
print("REACHING FUNCTION!");
await _initializeData();
isInputVisible = false;
}

@override
Expand Down Expand Up @@ -321,7 +321,6 @@ class _InputBubbleState extends State<InputBubble> {

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');
Expand All @@ -347,6 +346,7 @@ class _InputBubbleState extends State<InputBubble> {

if (response.statusCode == 200) {
print('Answer sent successfully');
widget.reloadData();
} else {
print("Request failed with status: ${response.statusCode}");
throw Exception('Failed to send answer');
Expand Down Expand Up @@ -385,8 +385,6 @@ class _InputBubbleState extends State<InputBubble> {
onPressed: () {
// Handle sending the message
final newAnswer = _textController.text;
print("Sending message: $newAnswer");

_sendAnswer(newAnswer);
},
),
Expand Down

0 comments on commit 2a66f46

Please sign in to comment.