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:
@ -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