Skip to content

Commit

Permalink
adds a settings page
Browse files Browse the repository at this point in the history
  • Loading branch information
anima-regem committed Dec 15, 2024
1 parent c478367 commit c00000f
Showing 1 changed file with 76 additions and 5 deletions.
81 changes: 76 additions & 5 deletions lib/screens/settings_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,49 @@ import 'package:url_launcher/url_launcher.dart';
import 'package:vyajan/services/helpers.dart';

class SettingsScreen extends StatelessWidget {
const SettingsScreen({super.key});

@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Settings'),
title: const Text('Settings'),
),
body: Column(
children: [
ListTile(
leading: const Icon(HugeIcons.strokeRoundedReload),
title: const Text(
'Check for updates',
style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold),
),
onTap: () {
getLatestVersion().then(
(latestVersion) {
if (latestVersion != null) {
if (latestVersion == getVersion()) {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text(
'You are using the latest version $latestVersion'),
),
);
} else {
final downloadURL = Uri.parse(
'https://github.com/anima-regem/Vyajan/releases');
launchUrl(downloadURL);
}
} else {
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(
content: Text('Failed to check for updates'),
),
);
}
},
);
},
),
ListTile(
leading: const Icon(HugeIcons.strokeRoundedGithub),
title: const Text(
Expand All @@ -26,12 +61,48 @@ class SettingsScreen extends StatelessWidget {
},
),
ListTile(
leading: const Icon(HugeIcons.strokeRoundedReload),
leading: const Icon(HugeIcons.strokeRoundedMail01),
title: const Text(
'Email',
style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold),
),
subtitle: const Text('Send feedback to the developer)'),
onTap: () {
final Uri email = Uri.parse('mailto:[email protected]');
launchUrl(email);
}),
ListTile(
leading: const Icon(HugeIcons.strokeRoundedCoffee01),
title: const Text(
'Buy me a coffee',
style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold),
),
subtitle: const Text('I love coffee! (Just UPI, hehe)'),
onTap: () {
final Uri upi =
Uri.parse('https://buymeacoffee.com/vichukartha');
launchUrl(upi);
}),
ListTile(
leading: const Icon(HugeIcons.strokeRoundedInformationCircle),
title: const Text(
'Check for updates',
'Version',
style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold),
),
subtitle: Text('Current Version : ${getVersion()}'),
)
subtitle: Text('Current version: ${getVersion()}'),
),
ListTile(
leading: const Icon(HugeIcons.strokeRoundedNews),
title: const Text(
'Wiki',
style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold),
),
subtitle: const Text('Read more about the app'),
onTap: () {
final Uri wiki =
Uri.parse('https://github.com/anima-regem/Vyajan/wiki');
launchUrl(wiki);
}),
],
),
);
Expand Down

0 comments on commit c00000f

Please sign in to comment.