2
0
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:
Oliver 2023-02-27 21:13:26 +11:00 committed by GitHub
parent 84f7e90569
commit ee0a6815f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 8 deletions

View File

@ -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)
-------- --------

View File

@ -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);
}
},
) )
); );
} }