mirror of
https://github.com/HendrikRauh/inventree-app.git
synced 2026-01-13 03:26:24 +00:00
Update for credits display (#274)
- Cleaner display - Links are now clickable
This commit is contained in:
parent
84f7e90569
commit
ee0a6815f4
2 changed files with 22 additions and 8 deletions
|
|
@ -13,12 +13,7 @@ Thanks to the following contributors, for their work building this app!
|
|||
|
||||
The InvenTree App makes use of the following third party assets
|
||||
|
||||
### Icons
|
||||
|
||||
Icons are provided by [fontawesome](fontawesome.com)
|
||||
|
||||
### Sound Files
|
||||
|
||||
Sound files have been sourced from [https://www.zapsplat.com](https://www.zapsplat.com)
|
||||
- Icons are provided by [fontawesome](https://fontawesome.com)
|
||||
- Sound files have been sourced from [zapsplat](https://www.zapsplat.com)
|
||||
|
||||
--------
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
import "package:flutter/material.dart";
|
||||
import "package:flutter_markdown/flutter_markdown.dart";
|
||||
import "package:inventree/l10.dart";
|
||||
import "package:url_launcher/url_launcher.dart";
|
||||
|
||||
|
||||
class ReleaseNotesWidget extends StatelessWidget {
|
||||
|
|
@ -30,6 +31,18 @@ class CreditsWidget extends StatelessWidget {
|
|||
|
||||
final String credits;
|
||||
|
||||
/*
|
||||
* Callback function when a link is clicked in the markdown
|
||||
*/
|
||||
Future<void> openLink(String url) async {
|
||||
|
||||
final link = Uri.parse(url);
|
||||
|
||||
if (await canLaunchUrl(link)) {
|
||||
await launchUrl(link);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build (BuildContext context) {
|
||||
return Scaffold(
|
||||
|
|
@ -38,7 +51,13 @@ class CreditsWidget extends StatelessWidget {
|
|||
),
|
||||
body: Markdown(
|
||||
selectable: false,
|
||||
data: credits
|
||||
data: credits,
|
||||
onTapLink: (url, href, title) {
|
||||
var link = href ?? "";
|
||||
if (link.isNotEmpty) {
|
||||
openLink(link);
|
||||
}
|
||||
},
|
||||
)
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue