mirror of
https://github.com/inventree/inventree-app.git
synced 2026-10-08 00:02:05 +00:00
Add settings to control sounds
This commit is contained in:
1 parent
194be50337
commit
989e0e81b3
4 files changed
+106
-25
No files matched your search
@@ -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,
|
||||
|
||||
Reference in new issue
Block a user