From 79e56d12ba48151902b689fb35fc2aabe9c9b9c1 Mon Sep 17 00:00:00 2001 From: "audric.sabatier" Date: Sun, 15 Jan 2023 23:19:52 -0500 Subject: [PATCH] ADD : Display users on top of conv page --- .../lib/views/pages/main/p_conversation.dart | 8 +++++--- .../lib/views/pages/main/w_messages.dart | 4 ++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Sources/dafl_project_flutter/lib/views/pages/main/p_conversation.dart b/Sources/dafl_project_flutter/lib/views/pages/main/p_conversation.dart index 67b8949..86e7ae1 100644 --- a/Sources/dafl_project_flutter/lib/views/pages/main/p_conversation.dart +++ b/Sources/dafl_project_flutter/lib/views/pages/main/p_conversation.dart @@ -10,14 +10,16 @@ class ConversationPage extends StatefulWidget { ConversationPage({Key? key, required String this.sender}) : super(key: key); @override - State createState() => _ConversationPageState(); + State createState() => _ConversationPageState(sender); } class _ConversationPageState extends State { String destinataire = 'test'; List messages = []; bool isNull = true; - String receiver = 'test'; + final String receiver; + + _ConversationPageState(this.receiver); final messageTextField = TextEditingController(); @@ -145,7 +147,7 @@ class _ConversationPageState extends State { const SizedBox( width: 20, ), - const Text("Max"), + Text(receiver), const Spacer(), IconButton( splashColor: Colors.grey.withOpacity(0.2), diff --git a/Sources/dafl_project_flutter/lib/views/pages/main/w_messages.dart b/Sources/dafl_project_flutter/lib/views/pages/main/w_messages.dart index 795ba63..0cc378c 100644 --- a/Sources/dafl_project_flutter/lib/views/pages/main/w_messages.dart +++ b/Sources/dafl_project_flutter/lib/views/pages/main/w_messages.dart @@ -240,7 +240,7 @@ class ListConfirmedWidget extends StatelessWidget { reverseDuration: const Duration(milliseconds: 200), type: PageTransitionType.rightToLeftWithFade, childCurrent: context.widget, - child: const ConversationPage())); + child: ConversationPage(sender : data['user']))); }, child: MessagesButtonWidget(sender : data['user']) ); @@ -268,7 +268,7 @@ class ListWaitingWidget extends StatelessWidget { reverseDuration: const Duration(milliseconds: 200), type: PageTransitionType.rightToLeftWithFade, childCurrent: context.widget, - child: const ConversationPage())); + child: ConversationPage(sender :'test'))); }, child: const MessagesButtonWidget(sender : "test6"), ),