2
0
mirror of https://github.com/inventree/inventree-app.git synced 2025-06-14 11:15:26 +00:00

Update release notes (#302)

This commit is contained in:
Oliver
2023-04-09 00:14:09 +10:00
committed by GitHub
parent a8f87e2f5a
commit bf8a65fadf
3 changed files with 19 additions and 4 deletions

View File

@ -10,6 +10,16 @@ class ReleaseNotesWidget extends StatelessWidget {
final String releaseNotes;
// 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(
@ -19,6 +29,12 @@ class ReleaseNotesWidget extends StatelessWidget {
body: Markdown(
selectable: false,
data: releaseNotes,
onTapLink: (url, href, title) {
var link = href ?? "";
if (link.isNotEmpty) {
openLink(link);
}
},
)
);
}
@ -31,9 +47,7 @@ class CreditsWidget extends StatelessWidget {
final String credits;
/*
* Callback function when a link is clicked in the markdown
*/
// Callback function when a link is clicked in the markdown
Future<void> openLink(String url) async {
final link = Uri.parse(url);