feat: Integrate ErrorService for improved error handling and add imageUrl field to Trip model
This commit is contained in:
@@ -4,6 +4,7 @@ import 'package:travel_mate/blocs/trip/trip_bloc.dart';
|
||||
import 'package:travel_mate/blocs/trip/trip_event.dart';
|
||||
import 'package:travel_mate/components/home/create_trip_content.dart';
|
||||
import 'package:travel_mate/models/trip.dart';
|
||||
import 'package:travel_mate/services/error_service.dart';
|
||||
import 'package:url_launcher/url_launcher.dart'; // Ajouter cet import
|
||||
import 'package:travel_mate/components/map/map_content.dart'; // Ajouter cet import si la page carte existe
|
||||
|
||||
@@ -16,6 +17,8 @@ class ShowTripDetailsContent extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _ShowTripDetailsContentState extends State<ShowTripDetailsContent> {
|
||||
final ErrorService _errorService = ErrorService();
|
||||
|
||||
// Méthode pour ouvrir la carte interne
|
||||
void _openInternalMap() {
|
||||
Navigator.push(
|
||||
@@ -45,13 +48,9 @@ class _ShowTripDetailsContentState extends State<ShowTripDetailsContent> {
|
||||
} else {
|
||||
// Si rien ne marche, afficher un message d'erreur
|
||||
if (mounted) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
const SnackBar(
|
||||
content: Text(
|
||||
'Impossible d\'ouvrir Google Maps. Vérifiez que l\'application est installée.',
|
||||
),
|
||||
backgroundColor: Colors.red,
|
||||
),
|
||||
_errorService.showError(
|
||||
message:
|
||||
'Impossible d\'ouvrir Google Maps, veuillez vérifier que l\'application est installée.',
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user