Restructuration majeure du projet: migration de flutt vers app, ajout de l'API et mise à jour du site web

This commit is contained in:
d6soft
2025-05-16 09:19:03 +02:00
parent b5aafc424b
commit 5c2620de30
391 changed files with 19780 additions and 7233 deletions

View File

@@ -0,0 +1,79 @@
import 'package:flutter/material.dart';
import '../widgets/conversations_list.dart';
import '../widgets/chat_screen.dart';
/// Page principale du module chat
///
/// Cette page sert de point d'entrée pour le module chat
/// et gère la navigation entre les conversations
class ChatPage extends StatefulWidget {
const ChatPage({super.key});
@override
State<ChatPage> createState() => _ChatPageState();
}
class _ChatPageState extends State<ChatPage> {
String? _selectedConversationId;
@override
Widget build(BuildContext context) {
final isLargeScreen = MediaQuery.of(context).size.width > 900;
if (isLargeScreen) {
// Vue desktop (séparée en deux panneaux)
return Scaffold(
body: Row(
children: [
// Liste des conversations à gauche
SizedBox(
width: 300,
child: ConversationsList(
onConversationSelected: (conversation) {
setState(() {
_selectedConversationId = 'conversation-id'; // TODO: obtenir l'ID de la conversation
});
},
),
),
const VerticalDivider(width: 1),
// Conversation sélectionnée à droite
Expanded(
child: _selectedConversationId != null
? ChatScreen(conversationId: _selectedConversationId!)
: const Center(child: Text('Sélectionnez une conversation')),
),
],
),
);
} else {
// Vue mobile
return Scaffold(
appBar: AppBar(
title: const Text('Chat'),
actions: [
IconButton(
icon: const Icon(Icons.add),
onPressed: () {
// TODO: Créer une nouvelle conversation
},
),
],
),
body: ConversationsList(
onConversationSelected: (conversation) {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => ChatScreen(
conversationId: 'conversation-id', // TODO: obtenir l'ID de la conversation
),
),
);
},
),
);
}
}
}