add showmodal

This commit is contained in:
2025-09-13 01:02:42 +02:00
parent 6c2324cb91
commit 5354575430

View File

@@ -853,12 +853,55 @@ class _MyHomePageState extends State<ListItemMenu> {
),
],
),
floatingActionButton: FloatingActionButton(
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),
),
)
]),
);
}