## Corrections Critiques ### Race Condition - Statuts de Messages - Fix : Les icônes de statut (✓, ✓✓, ✓✓ bleu) ne s'affichaient pas - Cause : WebSocket delivery confirmations arrivaient avant messages locaux - Solution : Pattern Optimistic UI dans chat_bloc.dart - Création message temporaire immédiate - Ajout à la liste AVANT requête HTTP - Remplacement par message serveur à la réponse - Fichier : lib/presentation/state_management/chat_bloc.dart ## Implémentation TODOs (13/21) ### Social (social_header_widget.dart) - ✅ Copier lien du post dans presse-papiers - ✅ Partage natif via Share.share() - ✅ Dialogue de signalement avec 5 raisons ### Partage (share_post_dialog.dart) - ✅ Interface sélection d'amis avec checkboxes - ✅ Partage externe via Share API ### Média (media_upload_service.dart) - ✅ Parsing JSON réponse backend - ✅ Méthode deleteMedia() pour suppression - ✅ Génération miniature vidéo ### Posts (create_post_dialog.dart, edit_post_dialog.dart) - ✅ Extraction URL depuis uploads - ✅ Documentation chargement médias ### Chat (conversations_screen.dart) - ✅ Navigation vers notifications - ✅ ConversationSearchDelegate pour recherche ## Nouveaux Fichiers ### Configuration - build-prod.ps1 : Script build production avec dart-define - lib/core/constants/env_config.dart : Gestion environnements ### Documentation - TODOS_IMPLEMENTED.md : Documentation complète TODOs ## Améliorations ### Architecture - Refactoring injection de dépendances - Amélioration routing et navigation - Optimisation providers (UserProvider, FriendsProvider) ### UI/UX - Amélioration thème et couleurs - Optimisation animations - Meilleure gestion erreurs ### Services - Configuration API avec env_config - Amélioration datasources (events, users) - Optimisation modèles de données
85 lines
3.0 KiB
Dart
85 lines
3.0 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:google_maps_flutter/google_maps_flutter.dart';
|
|
|
|
import '../../../core/utils/app_logger.dart';
|
|
|
|
/// Écran pour la sélection d'une localisation sur une carte.
|
|
/// L'utilisateur peut choisir un lieu en interagissant avec la carte Google Maps.
|
|
/// Des logs permettent de tracer les actions comme la sélection et l'affichage de la carte.
|
|
class LocationPickerScreen extends StatefulWidget {
|
|
const LocationPickerScreen({super.key});
|
|
|
|
@override
|
|
_LocationPickerScreenState createState() => _LocationPickerScreenState();
|
|
}
|
|
|
|
class _LocationPickerScreenState extends State<LocationPickerScreen> {
|
|
LatLng _pickedLocation = const LatLng(37.7749, -122.4194); // Localisation par défaut (San Francisco)
|
|
late GoogleMapController _mapController; // Contrôleur de la carte Google Maps
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
AppLogger.d('Affichage de l\'écran de sélection de localisation.', tag: 'LocationPickerScreen');
|
|
|
|
return Scaffold(
|
|
appBar: AppBar(
|
|
title: const Text('Sélectionnez un lieu'),
|
|
backgroundColor: Colors.blueAccent,
|
|
),
|
|
body: Column(
|
|
children: [
|
|
Expanded(
|
|
child: GoogleMap(
|
|
initialCameraPosition: CameraPosition(
|
|
target: _pickedLocation,
|
|
zoom: 14,
|
|
),
|
|
onMapCreated: (controller) {
|
|
_mapController = controller;
|
|
AppLogger.d('Carte Google Maps créée.', tag: 'LocationPickerScreen');
|
|
},
|
|
onTap: _selectLocation, // Sélection de la localisation sur la carte
|
|
markers: {
|
|
Marker(
|
|
markerId: const MarkerId('pickedLocation'),
|
|
position: _pickedLocation,
|
|
),
|
|
},
|
|
),
|
|
),
|
|
Padding(
|
|
padding: const EdgeInsets.all(16),
|
|
child: ElevatedButton.icon(
|
|
onPressed: () {
|
|
AppLogger.d('Lieu sélectionné : $_pickedLocation', tag: 'LocationPickerScreen');
|
|
Navigator.of(context).pop(_pickedLocation);
|
|
},
|
|
icon: const Icon(Icons.check),
|
|
label: const Text('Confirmer la localisation'),
|
|
style: ElevatedButton.styleFrom(
|
|
minimumSize: const Size(double.infinity, 50),
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
|
|
/// Fonction pour gérer la sélection d'une localisation sur la carte.
|
|
/// Lorsqu'une localisation est sélectionnée, elle est ajoutée à la carte et les logs sont mis à jour.
|
|
void _selectLocation(LatLng position) {
|
|
setState(() {
|
|
_pickedLocation = position;
|
|
});
|
|
AppLogger.d('Localisation sélectionnée : $_pickedLocation', tag: 'LocationPickerScreen');
|
|
}
|
|
|
|
@override
|
|
void dispose() {
|
|
_mapController.dispose();
|
|
AppLogger.d('Libération des ressources de la carte.', tag: 'LocationPickerScreen');
|
|
super.dispose();
|
|
}
|
|
}
|