feat: Mise à jour de la version de l'application à 1.1.7 et ajout de la gestion des sons pour le web

This commit is contained in:
ElPoyo
2026-02-24 14:15:25 +01:00
parent 890449d5e3
commit cc7abba373
5 changed files with 34 additions and 30 deletions

View File

@@ -1,6 +1,6 @@
/// Configuration de la version de l'application
class AppVersion {
static const String version = '1.1.6';
static const String version = '1.1.7';
/// Retourne la version complète de l'application
static String get fullVersion => 'v$version';

View File

@@ -1,3 +1,4 @@
import 'package:flutter/foundation.dart' show kIsWeb;
import 'package:flutter/services.dart';
import 'package:audioplayers/audioplayers.dart';
import 'package:em2rp/utils/debug_log.dart';
@@ -9,12 +10,14 @@ class AudioFeedbackService {
/// Jouer un son de succès
static Future<void> playSuccessBeep() async {
try {
// Jouer un son système
await HapticFeedback.mediumImpact();
await SystemSound.play(SystemSoundType.click);
// Alternative : jouer un son personnalisé si disponible
// await _player.play(AssetSource('sounds/success.mp3'));
if (kIsWeb) {
// Sur Web, utiliser le chemin absolu
await _player.play(UrlSource('assets/sounds/ok.mp3'));
} else {
// Sur mobile/desktop, utiliser AssetSource
await _player.play(AssetSource('sounds/ok.mp3'));
}
await HapticFeedback.lightImpact();
} catch (e) {
DebugLog.error('[AudioFeedbackService] Error playing success beep', e);
}
@@ -23,14 +26,14 @@ class AudioFeedbackService {
/// Jouer un son d'erreur
static Future<void> playErrorBeep() async {
try {
// Double bip pour indiquer une erreur
if (kIsWeb) {
// Sur Web, utiliser le chemin absolu
await _player.play(UrlSource('assets/sounds/error.mp3'));
} else {
// Sur mobile/desktop, utiliser AssetSource
await _player.play(AssetSource('sounds/error.mp3'));
}
await HapticFeedback.heavyImpact();
await SystemSound.play(SystemSoundType.click);
await Future.delayed(const Duration(milliseconds: 100));
await SystemSound.play(SystemSoundType.click);
// Alternative : jouer un son d'erreur personnalisé si disponible
// await _player.play(AssetSource('sounds/error.mp3'));
} catch (e) {
DebugLog.error('[AudioFeedbackService] Error playing error beep', e);
}