From 5354575430d828422d37e55f27dcdbd9d99f3fe3 Mon Sep 17 00:00:00 2001 From: Valentin CZERYBA Date: Sat, 13 Sep 2025 01:02:42 +0200 Subject: [PATCH] add showmodal --- covas_mobile_new/lib/pages/ListItemMenu.dart | 55 +++++++++++++++++--- 1 file changed, 49 insertions(+), 6 deletions(-) diff --git a/covas_mobile_new/lib/pages/ListItemMenu.dart b/covas_mobile_new/lib/pages/ListItemMenu.dart index ee26b23..abcca68 100644 --- a/covas_mobile_new/lib/pages/ListItemMenu.dart +++ b/covas_mobile_new/lib/pages/ListItemMenu.dart @@ -853,12 +853,55 @@ class _MyHomePageState extends State { ), ], ), - floatingActionButton: FloatingActionButton( - onPressed: popCamera, - backgroundColor: Colors.blue, - tooltip: loc?.search ?? 'Recherche', - child: const Icon(Icons.photo_camera, color: Colors.white), - ), + floatingActionButton: Column(mainAxisSize: MainAxisSize.min, children: [ + const SizedBox(height: 12), // espace entre les deux boutons + FloatingActionButton( + heroTag: "btn2", + onPressed: () { + // Action du deuxième bouton : ouvrir ton modal + showDialog( + context: context, + builder: (context) { + final controller = TextEditingController(); + return AlertDialog( + title: Text("Nouveau message"), + content: TextField( + controller: controller, + decoration: + InputDecoration(hintText: "Écris ton message..."), + ), + actions: [ + TextButton( + onPressed: () => Navigator.pop(context), + child: Text("Annuler"), + ), + ElevatedButton( + onPressed: () { + final msg = controller.text.trim(); + if (msg.isNotEmpty) { + print("Message saisi: $msg"); + // ➝ ici tu peux envoyer à ton chatbot + } + Navigator.pop(context); + }, + child: Text("Envoyer"), + ) + ], + ); + }, + ); + }, + backgroundColor: Colors.green, + tooltip: 'Chatbot', + child: const Icon(Icons.chat, color: Colors.white), + ), + FloatingActionButton( + onPressed: popCamera, + backgroundColor: Colors.blue, + tooltip: loc?.search ?? 'Recherche', + child: const Icon(Icons.photo_camera, color: Colors.white), + ) + ]), ); }