From 862194a6724d5c20ead274ef6ce2d46ce3fa5f4d Mon Sep 17 00:00:00 2001 From: winsdominoes Date: Mon, 4 Mar 2024 19:35:51 +0700 Subject: [PATCH] Fixed Settings UI --- lib/pages/settings.dart | 168 +++++++++++++++++++--------------------- 1 file changed, 78 insertions(+), 90 deletions(-) diff --git a/lib/pages/settings.dart b/lib/pages/settings.dart index fae76c5..3536e6d 100644 --- a/lib/pages/settings.dart +++ b/lib/pages/settings.dart @@ -24,101 +24,89 @@ class _Body extends StatelessWidget { return Scaffold( body: Column( children: [ - Padding( - padding: const EdgeInsets.only(top: 16, left: 16), - child: Container( - alignment: Alignment.centerLeft, - child: Row( - children: [ - Text("Settings", - style: TextStyle( - fontSize: textTheme.displayMedium?.fontSize, - fontWeight: FontWeight.bold)) - ], - )), - ), Expanded( child: Padding( - padding: const EdgeInsets.only(bottom: 16, left: 16, right: 16), - child: ListView.separated( - itemBuilder: (context, index) => const _ListItem(), - separatorBuilder: (context, index) => const SizedBox( - height: 20, - ), - itemCount: 1, - ), - ), + padding: const EdgeInsets.all(16), + child: ListView( + children: [ + Column( + children: [ + Container( + alignment: Alignment.centerLeft, + child: Row( + children: [ + Text("Settings", + style: TextStyle( + fontSize: + textTheme.displayMedium?.fontSize, + fontWeight: FontWeight.bold)) + ], + )), + Card( + elevation: 4, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10.0)), + margin: const EdgeInsets.all(8.0), + child: Column( + children: [ + InkWell( + onTap: () async { + await launchUrl( + Uri.parse( + 'https://git.winscloud.net/WinsDominoes/dateapp'), + mode: LaunchMode.externalApplication); + }, + borderRadius: const BorderRadius.only( + topLeft: Radius.circular(10.0), + topRight: Radius.circular(10.0)), + child: const ListTile( + leading: Icon(Icons.code), + title: Text("Source Code"), + trailing: Wrap( + // space between two icons + children: [ + Icon( + Icons.open_in_new), // icon-1// icon-2 + ], + ), + ), + ), + const Divider( + height: 1.0, + ), + InkWell( + onTap: () => communityDialogBuilder(context), + borderRadius: const BorderRadius.only( + bottomLeft: Radius.circular(10.0), + bottomRight: Radius.circular(10.0)), + child: const ListTile( + leading: Icon(Icons.people), + title: Text("Join Community"), + )), + ], + ), + ), + Card( + elevation: 4.0, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10.0)), + margin: const EdgeInsets.all(8.0), + child: InkWell( + onTap: () => aboutDialogBuilder(context), + borderRadius: + const BorderRadius.all(Radius.circular(10.0)), + child: const ListTile( + leading: Icon(Icons.info_outlined), + title: Text("About"), + ), + )) + ], + ), + ], + )), ) ], ), ); } } - -class _ListItem extends StatelessWidget { - const _ListItem(); - - @override - Widget build(BuildContext context) { - return Column( - children: [ - Card( - elevation: 4, - shape: - RoundedRectangleBorder(borderRadius: BorderRadius.circular(10.0)), - margin: const EdgeInsets.all(8.0), - child: Column( - children: [ - InkWell( - onTap: () async { - await launchUrl( - Uri.parse( - 'https://git.winscloud.net/WinsDominoes/dateapp'), - mode: LaunchMode.externalApplication); - }, - borderRadius: const BorderRadius.only( - topLeft: Radius.circular(10.0), - topRight: Radius.circular(10.0)), - child: const ListTile( - leading: Icon(Icons.code), - title: Text("Source Code"), - trailing: Wrap( - // space between two icons - children: [ - Icon(Icons.open_in_new), // icon-1// icon-2 - ], - ), - ), - ), - const Divider( - height: 1.0, - ), - InkWell( - onTap: () => communityDialogBuilder(context), - borderRadius: const BorderRadius.only( - bottomLeft: Radius.circular(10.0), - bottomRight: Radius.circular(10.0)), - child: const ListTile( - leading: Icon(Icons.people), - title: Text("Join Community"), - )), - ], - ), - ), - Card( - elevation: 4.0, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(10.0)), - margin: const EdgeInsets.all(8.0), - child: InkWell( - onTap: () => aboutDialogBuilder(context), - borderRadius: const BorderRadius.all(Radius.circular(10.0)), - child: const ListTile( - leading: Icon(Icons.info_outlined), - title: Text("About"), - ), - )) - ], - ); - } -}