-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c478367
commit c00000f
Showing
1 changed file
with
76 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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( | ||
|
@@ -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); | ||
}), | ||
], | ||
), | ||
); | ||
|