diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 112f694..2839cf7 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -42,5 +42,10 @@ + + + + + diff --git a/lib/pages/help.dart b/lib/pages/help.dart index 16feec6..9deed13 100644 --- a/lib/pages/help.dart +++ b/lib/pages/help.dart @@ -1,4 +1,21 @@ +// Flutter import 'package:flutter/material.dart'; +import 'package:url_launcher/url_launcher_string.dart'; + +_launchSite(String url) async { + try { + if (await canLaunchUrlString(url)) { + await launchUrlString( + url, + mode: LaunchMode.externalApplication, + ); + } else { + throw "System does not think it can launch '$url'."; + } + } on Exception catch (e) { + throw e.toString(); + } +} class HelpPage extends StatelessWidget { const HelpPage({ @@ -41,7 +58,9 @@ class HelpPage extends StatelessWidget { color: theme.colorScheme.onPrimary, ), child: TextButton.icon( - onPressed: () {}, + onPressed: () { + _launchSite("https://git.hyperling.com/me"); + }, icon: Icon(Icons.code), label: Text("Code Repository"), ), @@ -57,7 +76,9 @@ class HelpPage extends StatelessWidget { color: theme.colorScheme.onPrimary, ), child: TextButton.icon( - onPressed: () {}, + onPressed: () { + _launchSite("https://hyperling.com"); + }, icon: Icon(Icons.web_asset), label: Text("Personal Website"), ),