mirror of
https://github.com/inventree/inventree-app.git
synced 2025-04-28 05:26:47 +00:00
Update for credits display (#274)
- Cleaner display - Links are now clickable
This commit is contained in:
parent
84f7e90569
commit
ee0a6815f4
@ -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…
x
Reference in New Issue
Block a user