From 248107fcf92144c14773d5b067e9e49b79f8f88e Mon Sep 17 00:00:00 2001 From: Juan Gilsanz Polo Date: Fri, 4 Nov 2022 01:22:57 +0100 Subject: [PATCH] Adjustments on servers screen --- lib/widgets/add_server_modal.dart | 17 +++--- lib/widgets/servers_list/servers_list.dart | 70 ++++++++++++---------- 2 files changed, 45 insertions(+), 42 deletions(-) diff --git a/lib/widgets/add_server_modal.dart b/lib/widgets/add_server_modal.dart index 6d4663b..a2ce199 100644 --- a/lib/widgets/add_server_modal.dart +++ b/lib/widgets/add_server_modal.dart @@ -61,8 +61,8 @@ class _AddServerModalState extends State { Widget sectionLabel(String label) { return Padding( padding: const EdgeInsets.symmetric( - horizontal: 20, - vertical: 30 + horizontal: 24, + vertical: 24 ), child: Text( label, @@ -87,7 +87,7 @@ class _AddServerModalState extends State { String? helperText }) { return Padding( - padding: const EdgeInsets.symmetric(horizontal: 20), + padding: const EdgeInsets.symmetric(horizontal: 24), child: TextFormField( controller: controller, onChanged: onChanged, @@ -465,7 +465,6 @@ class _AddServerModalState extends State { appBar: AppBar( systemOverlayStyle: systemUiOverlayStyleConfig(context), title: Text(AppLocalizations.of(context)!.createConnection), - elevation: 5, actions: [ Padding( padding: const EdgeInsets.only(right: 10), @@ -493,9 +492,9 @@ class _AddServerModalState extends State { Container( padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 10), margin: const EdgeInsets.only( - top: 30, - left: 20, - right: 20 + top: 24, + left: 24, + right: 24 ), decoration: BoxDecoration( color: Theme.of(context).primaryColor.withOpacity(0.05), @@ -601,7 +600,7 @@ class _AddServerModalState extends State { ? () => setState(() => defaultServer = !defaultServer) : null, child: Padding( - padding: const EdgeInsets.symmetric(horizontal: 20), + padding: const EdgeInsets.symmetric(horizontal: 24), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ @@ -629,7 +628,7 @@ class _AddServerModalState extends State { child: InkWell( onTap: () => setState(() => homeAssistant = !homeAssistant), child: Padding( - padding: const EdgeInsets.symmetric(horizontal: 20), + padding: const EdgeInsets.symmetric(horizontal: 24), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ diff --git a/lib/widgets/servers_list/servers_list.dart b/lib/widgets/servers_list/servers_list.dart index 6f1b291..d5655e6 100644 --- a/lib/widgets/servers_list/servers_list.dart +++ b/lib/widgets/servers_list/servers_list.dart @@ -218,44 +218,48 @@ class _ServersListState extends State with SingleTickerProviderStat return Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Container( - width: 48, - margin: const EdgeInsets.only(right: 12), - child: leadingIcon(servers[index]), - ), Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, + child: Row( children: [ - Text( - "${server.connectionMethod}://${server.domain}${server.path ?? ""}${server.port != null ? ':${server.port}' : ""}", - textAlign: TextAlign.center, - style: const TextStyle( - fontSize: 18, + Container( + margin: const EdgeInsets.only(right: 16), + child: leadingIcon(servers[index]), + ), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + "${server.connectionMethod}://${server.domain}${server.path ?? ""}${server.port != null ? ':${server.port}' : ""}", + textAlign: TextAlign.center, + style: const TextStyle( + fontSize: 16, + fontWeight: FontWeight.w400 + ), + ), + Column( + children: [ + const SizedBox(height: 3), + Text( + servers[index].name, + overflow: TextOverflow.ellipsis, + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.w400, + color: Theme.of(context).listTileTheme.iconColor + ), + ) + ], + ) + ], ), ), - Column( - children: [ - const SizedBox(height: 5), - Text( - servers[index].name, - overflow: TextOverflow.ellipsis, - style: TextStyle( - fontSize: 14, - color: Theme.of(context).listTileTheme.iconColor - ), - ) - ], - ) ], ), ), - Padding( - padding: const EdgeInsets.only(right: 10), - child: RotationTransition( - turns: animation, - child: const Icon(Icons.keyboard_arrow_down_rounded), - ), + RotationTransition( + turns: animation, + child: const Icon(Icons.keyboard_arrow_down_rounded), ), ], ); @@ -383,7 +387,7 @@ class _ServersListState extends State with SingleTickerProviderStat child: InkWell( onTap: () => widget.onChange(index), child: Padding( - padding: const EdgeInsets.all(10), + padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8), child: topRow(servers[index], index), ), ), @@ -393,7 +397,7 @@ class _ServersListState extends State with SingleTickerProviderStat child: InkWell( onTap: () => widget.onChange(index), child: Padding( - padding: const EdgeInsets.all(10), + padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8), child: Column( children: [ topRow(servers[index], index),