merge: add website link in about screen
This commit is contained in:
commit
4e0f8d8541
1 changed files with 23 additions and 0 deletions
|
|
@ -13,6 +13,7 @@ class AboutScreen extends StatefulWidget {
|
||||||
|
|
||||||
class _AboutScreenState extends State<AboutScreen> {
|
class _AboutScreenState extends State<AboutScreen> {
|
||||||
static const _supportEmail = 'support@car64.app';
|
static const _supportEmail = 'support@car64.app';
|
||||||
|
static const _websiteUrl = 'https://www.car64.app/';
|
||||||
|
|
||||||
PackageInfo? _packageInfo;
|
PackageInfo? _packageInfo;
|
||||||
|
|
||||||
|
|
@ -46,6 +47,18 @@ class _AboutScreenState extends State<AboutScreen> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<void> _openWebsite() async {
|
||||||
|
final uri = Uri.parse(_websiteUrl);
|
||||||
|
final launched = await launchUrl(uri, mode: LaunchMode.externalApplication);
|
||||||
|
if (!launched && mounted) {
|
||||||
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
|
const SnackBar(
|
||||||
|
content: Text('Could not open website. Please visit https://www.car64.app/'),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final theme = Theme.of(context);
|
final theme = Theme.of(context);
|
||||||
|
|
@ -139,6 +152,16 @@ class _AboutScreenState extends State<AboutScreen> {
|
||||||
),
|
),
|
||||||
|
|
||||||
const SizedBox(height: 20),
|
const SizedBox(height: 20),
|
||||||
|
SizedBox(
|
||||||
|
width: double.infinity,
|
||||||
|
child: OutlinedButton.icon(
|
||||||
|
onPressed: _openWebsite,
|
||||||
|
icon: const Icon(Icons.language),
|
||||||
|
label: const Text('Visit Website'),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
|
const SizedBox(height: 10),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
child: OutlinedButton.icon(
|
child: OutlinedButton.icon(
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue