From 68068214bb73d6aba3c5ee66f6776d8ab9f4db9f Mon Sep 17 00:00:00 2001 From: stopflock Date: Tue, 7 Oct 2025 15:15:09 -0500 Subject: [PATCH] deflock links on about screen --- lib/screens/about_screen.dart | 50 +++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/lib/screens/about_screen.dart b/lib/screens/about_screen.dart index 8e1596d..a87abd8 100644 --- a/lib/screens/about_screen.dart +++ b/lib/screens/about_screen.dart @@ -1,9 +1,25 @@ import 'package:flutter/material.dart'; +import 'package:url_launcher/url_launcher.dart'; import '../services/localization_service.dart'; class AboutScreen extends StatelessWidget { const AboutScreen({super.key}); + Future _launchUrl(String url, BuildContext context) async { + final uri = Uri.parse(url); + if (await canLaunchUrl(uri)) { + await launchUrl(uri, mode: LaunchMode.externalApplication); + } else { + if (context.mounted) { + ScaffoldMessenger.of(context).showSnackBar( + SnackBar( + content: Text('Could not open URL: $url'), + ), + ); + } + } + } + @override Widget build(BuildContext context) { final locService = LocalizationService.instance; @@ -48,10 +64,44 @@ class AboutScreen extends StatelessWidget { ), textAlign: TextAlign.center, ), + const SizedBox(height: 32), + _buildHelpLinks(context), ], ), ), ), ); } + + Widget _buildHelpLinks(BuildContext context) { + return Column( + children: [ + _buildLinkText(context, 'About DeFlock', 'https://deflock.me/about'), + const SizedBox(height: 8), + _buildLinkText(context, 'Privacy Policy', 'https://deflock.me/privacy'), + const SizedBox(height: 8), + _buildLinkText(context, 'DeFlock Discord', 'https://discord.gg/aV7v4R3sKT'), + const SizedBox(height: 8), + _buildLinkText(context, 'Source Code', 'https://github.com/FoggedLens/deflock-app'), + const SizedBox(height: 8), + _buildLinkText(context, 'Contact', 'https://deflock.me/contact'), + const SizedBox(height: 8), + _buildLinkText(context, 'Donate', 'https://deflock.me/donate'), + ], + ); + } + + Widget _buildLinkText(BuildContext context, String text, String url) { + return GestureDetector( + onTap: () => _launchUrl(url, context), + child: Text( + text, + style: Theme.of(context).textTheme.bodyMedium?.copyWith( + color: Theme.of(context).colorScheme.primary, + decoration: TextDecoration.underline, + ), + textAlign: TextAlign.center, + ), + ); + } } \ No newline at end of file