- Ajout système complet de gestion des secteurs avec contours géographiques - Import des contours départementaux depuis GeoJSON - API REST pour la gestion des secteurs (/api/sectors) - Service de géolocalisation pour déterminer les secteurs - Migration base de données avec tables x_departements_contours et sectors_adresses - Interface Flutter pour visualisation et gestion des secteurs - Ajout thème sombre dans l'application - Corrections diverses et optimisations 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
73 lines
2.3 KiB
Dart
Executable File
73 lines
2.3 KiB
Dart
Executable File
import 'package:flutter/material.dart';
|
|
|
|
/// Bulle de message
|
|
///
|
|
/// Ce widget affiche un message dans une conversation
|
|
/// avec les informations associées
|
|
|
|
class MessageBubble extends StatelessWidget {
|
|
final dynamic message; // TODO: Remplacer par MessageModel
|
|
final bool showSenderInfo;
|
|
final bool showTimestamp;
|
|
final bool showStatus;
|
|
final bool isAnnouncement;
|
|
final double maxWidth;
|
|
|
|
const MessageBubble({
|
|
super.key,
|
|
required this.message,
|
|
this.showSenderInfo = true,
|
|
this.showTimestamp = true,
|
|
this.showStatus = true,
|
|
this.isAnnouncement = false,
|
|
this.maxWidth = 300,
|
|
});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Container(
|
|
margin: const EdgeInsets.symmetric(vertical: 4, horizontal: 8),
|
|
child: Row(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
if (showSenderInfo) const CircleAvatar(child: Text('S')),
|
|
Expanded(
|
|
child: Container(
|
|
constraints: BoxConstraints(maxWidth: maxWidth),
|
|
margin: const EdgeInsets.only(left: 8),
|
|
padding: const EdgeInsets.all(12),
|
|
decoration: BoxDecoration(
|
|
color: isAnnouncement
|
|
? Colors.orange.shade100
|
|
: Colors.blue.shade100,
|
|
borderRadius: BorderRadius.circular(16),
|
|
),
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
if (showSenderInfo)
|
|
const Text(
|
|
'Expéditeur',
|
|
style: TextStyle(fontWeight: FontWeight.bold),
|
|
),
|
|
const Text('Contenu du message...'),
|
|
if (showTimestamp || showStatus)
|
|
Row(
|
|
mainAxisAlignment: MainAxisAlignment.end,
|
|
children: [
|
|
if (showTimestamp)
|
|
const Text('12:34', style: TextStyle(fontSize: 12)),
|
|
if (showStatus) const SizedBox(width: 4),
|
|
if (showStatus) const Icon(Icons.check, size: 16),
|
|
],
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|