mirror of
https://github.com/inventree/inventree-app.git
synced 2025-06-15 03:35:28 +00:00
Refactor audio file player
- Do not play if there is no context available (e.g. unit testing)
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
import "package:audioplayers/audioplayers.dart";
|
||||
import "package:flutter/material.dart";
|
||||
import "package:font_awesome_flutter/font_awesome_flutter.dart";
|
||||
import "package:inventree/helpers.dart";
|
||||
import "package:one_context/one_context.dart";
|
||||
|
||||
import "package:inventree/l10.dart";
|
||||
@ -108,8 +108,7 @@ Future<void> showServerError(String title, String description) async {
|
||||
final bool tones = await InvenTreeSettingsManager().getValue(INV_SOUNDS_SERVER, true) as bool;
|
||||
|
||||
if (tones) {
|
||||
final player = AudioCache();
|
||||
player.play("sounds/server_error.mp3");
|
||||
playAudioFile("sounds/server_error.mp3");
|
||||
}
|
||||
|
||||
showSnackIcon(
|
||||
|
Reference in New Issue
Block a user