From 7fc137680c236317a03c25aa050fd78eb8b84aba Mon Sep 17 00:00:00 2001 From: vyPal Date: Wed, 20 Sep 2023 08:19:49 +0200 Subject: [PATCH] Update drawer items order --- lib/home.dart | 102 ++++++++++++++++++++++++++++---------------------- 1 file changed, 58 insertions(+), 44 deletions(-) diff --git a/lib/home.dart b/lib/home.dart index 8f5ad60..7a08d77 100644 --- a/lib/home.dart +++ b/lib/home.dart @@ -697,53 +697,29 @@ class HomePageState extends State { highlightColor: Colors.transparent, splashColor: Colors.transparent, child: ListTile( - leading: const Icon(Icons.lunch_dining_rounded), - title: Text(local!.homeSetupICanteen), - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => ICanteenSetupScreen( - sessionManager: widget.sessionManager, - loadedCallback: () { - widget.reLogin(); - }, - ), - ), - ); - }, - ), - ), - InkWell( - highlightColor: Colors.transparent, - splashColor: Colors.transparent, - child: Badge( - label: Text(local.homePreview), - alignment: AlignmentDirectional.topEnd, - child: ListTile( - leading: const Icon(Icons.bolt_rounded), - title: Text(local.homeQuickstart), - trailing: Transform.scale( - scale: 0.75, - child: Switch( - value: quickstart, - onChanged: (bool value) { - sharedPreferences.setBool('quickstart', value); - setState(() { - quickstart = value; - }); - }, - ), + leading: const Icon(Icons.bolt_rounded), + title: Text(local!.homeQuickstart), + trailing: Transform.scale( + scale: 0.75, + child: Switch( + value: quickstart, + onChanged: (bool value) { + sharedPreferences.setBool('quickstart', value); + setState(() { + quickstart = value; + }); + }, ), - onTap: () { - sharedPreferences.setBool('quickstart', !quickstart); - setState(() { - quickstart = !quickstart; - }); - }, ), + onTap: () { + sharedPreferences.setBool('quickstart', !quickstart); + setState(() { + quickstart = !quickstart; + }); + }, ), ), + /* const Divider(), ListTile( leading: const Icon(Icons.language), @@ -775,8 +751,29 @@ class HomePageState extends State { ), ), ), - ), + ),*/ const Divider(), + InkWell( + highlightColor: Colors.transparent, + splashColor: Colors.transparent, + child: ListTile( + leading: const Icon(Icons.lunch_dining_rounded), + title: Text(local.homeSetupICanteen), + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => ICanteenSetupScreen( + sessionManager: widget.sessionManager, + loadedCallback: () { + widget.reLogin(); + }, + ), + ), + ); + }, + ), + ), InkWell( highlightColor: Colors.transparent, splashColor: Colors.transparent, @@ -791,6 +788,23 @@ class HomePageState extends State { }, ), ), + const Divider(), + InkWell( + highlightColor: Colors.transparent, + splashColor: Colors.transparent, + child: ListTile( + leading: const Icon(Icons.discord), + title: const Text("EduPage2 Discord"), + onTap: () async { + final url = Uri.parse('https://discord.gg/xy5nqWa2kQ'); + if (await canLaunchUrl(url)) { + await launchUrl(url); + } else { + throw 'Could not launch $url'; + } + }, + ), + ), const AboutListTile( icon: Icon(Icons.info_outline), applicationName: 'EduPage2',