Adjustments on servers screen

This commit is contained in:
Juan Gilsanz Polo 2022-11-04 01:22:57 +01:00
parent ea3606b762
commit 248107fcf9
2 changed files with 45 additions and 42 deletions

View file

@ -61,8 +61,8 @@ class _AddServerModalState extends State<AddServerModal> {
Widget sectionLabel(String label) { Widget sectionLabel(String label) {
return Padding( return Padding(
padding: const EdgeInsets.symmetric( padding: const EdgeInsets.symmetric(
horizontal: 20, horizontal: 24,
vertical: 30 vertical: 24
), ),
child: Text( child: Text(
label, label,
@ -87,7 +87,7 @@ class _AddServerModalState extends State<AddServerModal> {
String? helperText String? helperText
}) { }) {
return Padding( return Padding(
padding: const EdgeInsets.symmetric(horizontal: 20), padding: const EdgeInsets.symmetric(horizontal: 24),
child: TextFormField( child: TextFormField(
controller: controller, controller: controller,
onChanged: onChanged, onChanged: onChanged,
@ -465,7 +465,6 @@ class _AddServerModalState extends State<AddServerModal> {
appBar: AppBar( appBar: AppBar(
systemOverlayStyle: systemUiOverlayStyleConfig(context), systemOverlayStyle: systemUiOverlayStyleConfig(context),
title: Text(AppLocalizations.of(context)!.createConnection), title: Text(AppLocalizations.of(context)!.createConnection),
elevation: 5,
actions: [ actions: [
Padding( Padding(
padding: const EdgeInsets.only(right: 10), padding: const EdgeInsets.only(right: 10),
@ -493,9 +492,9 @@ class _AddServerModalState extends State<AddServerModal> {
Container( Container(
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 10), padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 10),
margin: const EdgeInsets.only( margin: const EdgeInsets.only(
top: 30, top: 24,
left: 20, left: 24,
right: 20 right: 24
), ),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Theme.of(context).primaryColor.withOpacity(0.05), color: Theme.of(context).primaryColor.withOpacity(0.05),
@ -601,7 +600,7 @@ class _AddServerModalState extends State<AddServerModal> {
? () => setState(() => defaultServer = !defaultServer) ? () => setState(() => defaultServer = !defaultServer)
: null, : null,
child: Padding( child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 20), padding: const EdgeInsets.symmetric(horizontal: 24),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
@ -629,7 +628,7 @@ class _AddServerModalState extends State<AddServerModal> {
child: InkWell( child: InkWell(
onTap: () => setState(() => homeAssistant = !homeAssistant), onTap: () => setState(() => homeAssistant = !homeAssistant),
child: Padding( child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 20), padding: const EdgeInsets.symmetric(horizontal: 24),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [

View file

@ -218,44 +218,48 @@ class _ServersListState extends State<ServersList> with SingleTickerProviderStat
return Row( return Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Container(
width: 48,
margin: const EdgeInsets.only(right: 12),
child: leadingIcon(servers[index]),
),
Expanded( Expanded(
child: Column( child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( Container(
"${server.connectionMethod}://${server.domain}${server.path ?? ""}${server.port != null ? ':${server.port}' : ""}", margin: const EdgeInsets.only(right: 16),
textAlign: TextAlign.center, child: leadingIcon(servers[index]),
style: const TextStyle( ),
fontSize: 18, 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( RotationTransition(
padding: const EdgeInsets.only(right: 10), turns: animation,
child: RotationTransition( child: const Icon(Icons.keyboard_arrow_down_rounded),
turns: animation,
child: const Icon(Icons.keyboard_arrow_down_rounded),
),
), ),
], ],
); );
@ -383,7 +387,7 @@ class _ServersListState extends State<ServersList> with SingleTickerProviderStat
child: InkWell( child: InkWell(
onTap: () => widget.onChange(index), onTap: () => widget.onChange(index),
child: Padding( child: Padding(
padding: const EdgeInsets.all(10), padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
child: topRow(servers[index], index), child: topRow(servers[index], index),
), ),
), ),
@ -393,7 +397,7 @@ class _ServersListState extends State<ServersList> with SingleTickerProviderStat
child: InkWell( child: InkWell(
onTap: () => widget.onChange(index), onTap: () => widget.onChange(index),
child: Padding( child: Padding(
padding: const EdgeInsets.all(10), padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
child: Column( child: Column(
children: [ children: [
topRow(servers[index], index), topRow(servers[index], index),