Retry
Some checks failed
Deploy Flutter to Firebase / deploy-android (push) Failing after 14m25s

This commit is contained in:
Van Leemput Dayron
2025-12-09 16:26:23 +01:00
parent 0fb1634a91
commit e5b2be5245

View File

@@ -41,12 +41,9 @@ class _TripCardState extends State<TripCard> {
}); });
try { try {
// D'abord vérifier si une image existe déjà dans le Storage
String? imageUrl = await _placeImageService.getExistingImageUrl( String? imageUrl = await _placeImageService.getExistingImageUrl(
widget.trip.location, widget.trip.location,
); );
// Si aucune image n'existe, en télécharger une nouvelle
imageUrl ??= await _placeImageService.getPlaceImageUrl( imageUrl ??= await _placeImageService.getPlaceImageUrl(
widget.trip.location, widget.trip.location,
); );
@@ -57,7 +54,6 @@ class _TripCardState extends State<TripCard> {
_isLoadingImage = false; _isLoadingImage = false;
}); });
// Mettre à jour le voyage dans la base de données avec l'imageUrl
_updateTripWithImage(imageUrl); _updateTripWithImage(imageUrl);
} else { } else {
setState(() { setState(() {
@@ -76,18 +72,13 @@ class _TripCardState extends State<TripCard> {
Future<void> _updateTripWithImage(String imageUrl) async { Future<void> _updateTripWithImage(String imageUrl) async {
try { try {
if (widget.trip.id != null) { if (widget.trip.id != null) {
// Créer une copie du voyage avec la nouvelle imageUrl
final updatedTrip = widget.trip.copyWith( final updatedTrip = widget.trip.copyWith(
imageUrl: imageUrl, imageUrl: imageUrl,
updatedAt: DateTime.now(), updatedAt: DateTime.now(),
); );
// Mettre à jour dans la base de données
await _tripRepository.updateTrip(widget.trip.id!, updatedTrip); await _tripRepository.updateTrip(widget.trip.id!, updatedTrip);
} }
} catch (e) { } catch (e) {}
// En cas d'erreur, on continue sans échec - l'image reste affichée localement
}
} }
Widget _buildImageWidget() { Widget _buildImageWidget() {