mirror of
https://github.com/HendrikRauh/inventree-app.git
synced 2026-01-13 03:26:24 +00:00
Adds debug message helper
This commit is contained in:
parent
2e86a02343
commit
625d29fcf1
3 changed files with 22 additions and 6 deletions
|
|
@ -7,9 +7,23 @@
|
|||
* supressing trailing zeroes
|
||||
*/
|
||||
|
||||
import "dart:io";
|
||||
|
||||
import "package:audioplayers/audioplayers.dart";
|
||||
import "package:one_context/one_context.dart";
|
||||
|
||||
|
||||
/*
|
||||
* Display a debug message if we are in testing mode, or running in debug mode
|
||||
*/
|
||||
void debug(dynamic msg) {
|
||||
|
||||
if (Platform.environment.containsKey("FLUTTER_TEST")) {
|
||||
print("DEBUG: ${msg.toString()}");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
String simpleNumberString(double number) {
|
||||
// Ref: https://stackoverflow.com/questions/55152175/how-to-remove-trailing-zeros-using-dart
|
||||
|
||||
|
|
@ -19,7 +33,7 @@ String simpleNumberString(double number) {
|
|||
/*
|
||||
* Play an audio file from the requested path.
|
||||
*
|
||||
* Note: If OneContext module fails the 'hasConext' check,
|
||||
* Note: If OneContext module fails the 'hasContext' check,
|
||||
* we will not attempt to play the sound
|
||||
*/
|
||||
Future<void> playAudioFile(String path) async {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue