mirror of
https://github.com/HendrikRauh/inventree-app.git
synced 2026-01-13 03:26:24 +00:00
Refactor audio file player
- Do not play if there is no context available (e.g. unit testing)
This commit is contained in:
parent
e424a3cf7b
commit
f13b04d029
7 changed files with 94 additions and 50 deletions
|
|
@ -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(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue