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:
@ -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
|
||||
*/
|
||||
|
Reference in New Issue
Block a user