mirror of
https://github.com/inventree/inventree-app.git
synced 2025-04-28 13:36:50 +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
|
The InvenTree App makes use of the following third party assets
|
||||||
|
|
||||||
### Icons
|
- Icons are provided by [fontawesome](https://fontawesome.com)
|
||||||
|
- Sound files have been sourced from [zapsplat](https://www.zapsplat.com)
|
||||||
Icons are provided by [fontawesome](fontawesome.com)
|
|
||||||
|
|
||||||
### Sound Files
|
|
||||||
|
|
||||||
Sound files have been sourced from [https://www.zapsplat.com](https://www.zapsplat.com)
|
|
||||||
|
|
||||||
--------
|
--------
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import "package:flutter/material.dart";
|
import "package:flutter/material.dart";
|
||||||
import "package:flutter_markdown/flutter_markdown.dart";
|
import "package:flutter_markdown/flutter_markdown.dart";
|
||||||
import "package:inventree/l10.dart";
|
import "package:inventree/l10.dart";
|
||||||
|
import "package:url_launcher/url_launcher.dart";
|
||||||
|
|
||||||
|
|
||||||
class ReleaseNotesWidget extends StatelessWidget {
|
class ReleaseNotesWidget extends StatelessWidget {
|
||||||
@ -30,6 +31,18 @@ class CreditsWidget extends StatelessWidget {
|
|||||||
|
|
||||||
final String credits;
|
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
|
@override
|
||||||
Widget build (BuildContext context) {
|
Widget build (BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
@ -38,7 +51,13 @@ class CreditsWidget extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
body: Markdown(
|
body: Markdown(
|
||||||
selectable: false,
|
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