2
0
mirror of https://github.com/inventree/inventree-app.git synced 2025-06-12 18:25:26 +00:00

Add settings to control sounds

This commit is contained in:
Oliver Walters
2021-03-03 21:39:46 +11:00
parent 194be50337
commit 989e0e81b3
4 changed files with 106 additions and 25 deletions

View File

@ -1,4 +1,5 @@
import 'package:InvenTree/app_settings.dart';
import 'package:InvenTree/widget/snacks.dart';
import 'package:audioplayers/audio_cache.dart';
import 'package:audioplayers/audioplayers.dart';
@ -116,8 +117,12 @@ Future<void> showServerError(String title, String description) async {
}
// Play a sound
AudioCache player = AudioCache();
player.play("sounds/server_error.mp3");
final bool tones = await InvenTreeSettingsManager().getValue("serverSounds", true) as bool;
if (tones) {
AudioCache player = AudioCache();
player.play("sounds/server_error.mp3");
}
showSnackIcon(
title,