2
0
mirror of https://github.com/inventree/inventree-app.git synced 2025-06-16 04:05:28 +00:00

Code Cleanup (#312)

* Open email and telephone links for company

* Cleanup imports
This commit is contained in:
Oliver
2023-04-11 22:38:57 +10:00
committed by GitHub
parent 946abb60a0
commit 164295c3e2
10 changed files with 74 additions and 56 deletions

View File

@ -9,9 +9,13 @@
import "dart:io";
import "package:currency_formatter/currency_formatter.dart";
import "package:audioplayers/audioplayers.dart";
import "package:one_context/one_context.dart";
import "package:url_launcher/url_launcher.dart";
import "package:audioplayers/audioplayers.dart";
import "package:inventree/l10.dart";
import "package:inventree/widget/snacks.dart";
List<String> debug_messages = [];
@ -80,6 +84,19 @@ Future<void> playAudioFile(String path) async {
}
// Open an external URL
Future<void> openLink(String url) async {
final link = Uri.parse(url);
try {
await launchUrl(link);
} catch (e) {
showSnackIcon(L10().error, success: false);
}
}
/*
* Helper function for rendering a money / currency object as a String
*/