From f36bee10959e4e8244c0b6a2319e9acc9e7b23a5 Mon Sep 17 00:00:00 2001 From: zarzet Date: Thu, 1 Jan 2026 20:49:12 +0700 Subject: [PATCH] feat: add GitHub links and credits to Settings --- lib/screens/settings_screen.dart | 43 +++++++++++++++++++++++++++++--- lib/screens/settings_tab.dart | 43 +++++++++++++++++++++++++++++--- 2 files changed, 80 insertions(+), 6 deletions(-) diff --git a/lib/screens/settings_screen.dart b/lib/screens/settings_screen.dart index 3cd76011..b4bbdabf 100644 --- a/lib/screens/settings_screen.dart +++ b/lib/screens/settings_screen.dart @@ -1,6 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:file_picker/file_picker.dart'; +import 'package:url_launcher/url_launcher.dart'; import 'package:spotiflac_android/providers/settings_provider.dart'; import 'package:spotiflac_android/providers/theme_provider.dart'; @@ -126,18 +127,47 @@ class SettingsScreen extends ConsumerWidget { onChanged: (value) => ref.read(settingsProvider.notifier).setMaxQualityCover(value), ), + const Divider(), + + // GitHub & Credits Section + _buildSectionHeader(context, 'GitHub & Credits', colorScheme), + + ListTile( + leading: Icon(Icons.code, color: colorScheme.primary), + title: const Text('SpotiFLAC Mobile'), + subtitle: const Text('github.com/zarzet/SpotiFLAC-Mobile'), + onTap: () => _launchUrl('https://github.com/zarzet/SpotiFLAC-Mobile'), + ), + + ListTile( + leading: Icon(Icons.computer, color: colorScheme.primary), + title: const Text('Original SpotiFLAC (Desktop)'), + subtitle: const Text('github.com/afkarxyz/SpotiFLAC'), + onTap: () => _launchUrl('https://github.com/afkarxyz/SpotiFLAC'), + ), + + Padding( + padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8), + child: Text( + 'Mobile version maintained by zarzet\nOriginal project by afkarxyz', + style: Theme.of(context).textTheme.bodySmall?.copyWith( + color: colorScheme.onSurfaceVariant, + ), + ), + ), + const Divider(), // About ListTile( leading: Icon(Icons.info, color: colorScheme.primary), title: const Text('About'), - subtitle: const Text('SpotiFLAC v1.0.3'), + subtitle: const Text('SpotiFLAC v1.0.4'), onTap: () => showAboutDialog( context: context, applicationName: 'SpotiFLAC', - applicationVersion: '1.0.3', - applicationLegalese: '© 2024 SpotiFLAC', + applicationVersion: '1.0.4', + applicationLegalese: '© 2024 SpotiFLAC\n\nMobile: zarzet\nOriginal: afkarxyz', ), ), ], @@ -423,4 +453,11 @@ class SettingsScreen extends ConsumerWidget { ref.read(settingsProvider.notifier).setDownloadDirectory(result); } } + + Future _launchUrl(String url) async { + final uri = Uri.parse(url); + if (await canLaunchUrl(uri)) { + await launchUrl(uri, mode: LaunchMode.externalApplication); + } + } } diff --git a/lib/screens/settings_tab.dart b/lib/screens/settings_tab.dart index 9d220f4a..feacb946 100644 --- a/lib/screens/settings_tab.dart +++ b/lib/screens/settings_tab.dart @@ -1,6 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:file_picker/file_picker.dart'; +import 'package:url_launcher/url_launcher.dart'; import 'package:spotiflac_android/providers/settings_provider.dart'; import 'package:spotiflac_android/providers/theme_provider.dart'; @@ -133,18 +134,47 @@ class _SettingsTabState extends ConsumerState with AutomaticKeepAli onChanged: (value) => ref.read(settingsProvider.notifier).setMaxQualityCover(value), ), + const Divider(), + + // GitHub & Credits Section + _buildSectionHeader(context, 'GitHub & Credits', colorScheme), + + ListTile( + leading: Icon(Icons.code, color: colorScheme.primary), + title: const Text('SpotiFLAC Mobile'), + subtitle: const Text('github.com/zarzet/SpotiFLAC-Mobile'), + onTap: () => _launchUrl('https://github.com/zarzet/SpotiFLAC-Mobile'), + ), + + ListTile( + leading: Icon(Icons.computer, color: colorScheme.primary), + title: const Text('Original SpotiFLAC (Desktop)'), + subtitle: const Text('github.com/afkarxyz/SpotiFLAC'), + onTap: () => _launchUrl('https://github.com/afkarxyz/SpotiFLAC'), + ), + + Padding( + padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8), + child: Text( + 'Mobile version maintained by zarzet\nOriginal project by afkarxyz', + style: Theme.of(context).textTheme.bodySmall?.copyWith( + color: colorScheme.onSurfaceVariant, + ), + ), + ), + const Divider(), // About ListTile( leading: Icon(Icons.info, color: colorScheme.primary), title: const Text('About'), - subtitle: const Text('SpotiFLAC v1.0.3'), + subtitle: const Text('SpotiFLAC v1.0.4'), onTap: () => showAboutDialog( context: context, applicationName: 'SpotiFLAC', - applicationVersion: '1.0.3', - applicationLegalese: '© 2024 SpotiFLAC', + applicationVersion: '1.0.4', + applicationLegalese: '© 2024 SpotiFLAC\n\nMobile: zarzet\nOriginal: afkarxyz', ), ), @@ -392,4 +422,11 @@ class _SettingsTabState extends ConsumerState with AutomaticKeepAli ref.read(settingsProvider.notifier).setDownloadDirectory(result); } } + + Future _launchUrl(String url) async { + final uri = Uri.parse(url); + if (await canLaunchUrl(uri)) { + await launchUrl(uri, mode: LaunchMode.externalApplication); + } + } }