mirror of
https://github.com/HendrikRauh/inventree-app.git
synced 2026-01-13 03:26:24 +00:00
Code Cleanup (#312)
* Open email and telephone links for company * Cleanup imports
This commit is contained in:
parent
946abb60a0
commit
164295c3e2
10 changed files with 74 additions and 56 deletions
|
|
@ -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
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue