Merge pull request #3282 from grummbeer/unify-text-input
Unify left labeled text input
This commit is contained in:
		
						commit
						99a5786adc
					
				| @ -996,14 +996,11 @@ void _rdpDialog(String id) async { | |||||||
|             Row( |             Row( | ||||||
|               children: [ |               children: [ | ||||||
|                 ConstrainedBox( |                 ConstrainedBox( | ||||||
|                     constraints: const BoxConstraints(minWidth: 100), |                     constraints: const BoxConstraints(minWidth: 140), | ||||||
|                     child: Text( |                     child: Text( | ||||||
|                       "${translate('Port')}:", |                       "${translate('Port')}:", | ||||||
|                       textAlign: TextAlign.start, |                       textAlign: TextAlign.right, | ||||||
|                     ).marginOnly(bottom: 16.0)), |                     ).marginOnly(right: 10)), | ||||||
|                 const SizedBox( |  | ||||||
|                   width: 24.0, |  | ||||||
|                 ), |  | ||||||
|                 Expanded( |                 Expanded( | ||||||
|                   child: TextField( |                   child: TextField( | ||||||
|                     inputFormatters: [ |                     inputFormatters: [ | ||||||
| @ -1017,21 +1014,15 @@ void _rdpDialog(String id) async { | |||||||
|                   ), |                   ), | ||||||
|                 ), |                 ), | ||||||
|               ], |               ], | ||||||
|             ), |             ).marginOnly(bottom: 8), | ||||||
|             const SizedBox( |  | ||||||
|               height: 8.0, |  | ||||||
|             ), |  | ||||||
|             Row( |             Row( | ||||||
|               children: [ |               children: [ | ||||||
|                 ConstrainedBox( |                 ConstrainedBox( | ||||||
|                     constraints: const BoxConstraints(minWidth: 100), |                     constraints: const BoxConstraints(minWidth: 140), | ||||||
|                     child: Text( |                     child: Text( | ||||||
|                       "${translate('Username')}:", |                       "${translate('Username')}:", | ||||||
|                       textAlign: TextAlign.start, |                       textAlign: TextAlign.right, | ||||||
|                     ).marginOnly(bottom: 16.0)), |                     ).marginOnly(right: 10)), | ||||||
|                 const SizedBox( |  | ||||||
|                   width: 24.0, |  | ||||||
|                 ), |  | ||||||
|                 Expanded( |                 Expanded( | ||||||
|                   child: TextField( |                   child: TextField( | ||||||
|                     decoration: |                     decoration: | ||||||
| @ -1040,19 +1031,15 @@ void _rdpDialog(String id) async { | |||||||
|                   ), |                   ), | ||||||
|                 ), |                 ), | ||||||
|               ], |               ], | ||||||
|             ), |             ).marginOnly(bottom: 8), | ||||||
|             const SizedBox( |  | ||||||
|               height: 8.0, |  | ||||||
|             ), |  | ||||||
|             Row( |             Row( | ||||||
|               children: [ |               children: [ | ||||||
|                 ConstrainedBox( |                 ConstrainedBox( | ||||||
|                     constraints: const BoxConstraints(minWidth: 100), |                     constraints: const BoxConstraints(minWidth: 140), | ||||||
|                     child: Text("${translate('Password')}:") |                     child: Text( | ||||||
|                         .marginOnly(bottom: 16.0)), |                       "${translate('Password')}:", | ||||||
|                 const SizedBox( |                       textAlign: TextAlign.right, | ||||||
|                   width: 24.0, |                     ).marginOnly(right: 10)), | ||||||
|                 ), |  | ||||||
|                 Expanded( |                 Expanded( | ||||||
|                   child: Obx(() => TextField( |                   child: Obx(() => TextField( | ||||||
|                         obscureText: secure.value, |                         obscureText: secure.value, | ||||||
| @ -1067,7 +1054,7 @@ void _rdpDialog(String id) async { | |||||||
|                       )), |                       )), | ||||||
|                 ), |                 ), | ||||||
|               ], |               ], | ||||||
|             ), |             ).marginOnly(bottom: 8), | ||||||
|           ], |           ], | ||||||
|         ), |         ), | ||||||
|       ), |       ), | ||||||
|  | |||||||
| @ -1074,7 +1074,7 @@ class _NetworkState extends State<_Network> with AutomaticKeepAliveClientMixin { | |||||||
|             Row( |             Row( | ||||||
|               mainAxisAlignment: MainAxisAlignment.end, |               mainAxisAlignment: MainAxisAlignment.end, | ||||||
|               children: [_Button('Apply', submit, enabled: enabled)], |               children: [_Button('Apply', submit, enabled: enabled)], | ||||||
|             ).marginOnly(top: 15), |             ).marginOnly(top: 10), | ||||||
|           ], |           ], | ||||||
|         ) |         ) | ||||||
|       ]); |       ]); | ||||||
| @ -1697,33 +1697,30 @@ _LabeledTextField( | |||||||
|     bool secure) { |     bool secure) { | ||||||
|   return Row( |   return Row( | ||||||
|     children: [ |     children: [ | ||||||
|       Spacer(flex: 1), |       ConstrainedBox( | ||||||
|       Expanded( |           constraints: const BoxConstraints(minWidth: 140), | ||||||
|         flex: 4, |  | ||||||
|           child: Text( |           child: Text( | ||||||
|             '${translate(label)}:', |             '${translate(label)}:', | ||||||
|             textAlign: TextAlign.right, |             textAlign: TextAlign.right, | ||||||
|           style: TextStyle(color: _disabledTextColor(context, enabled)), |             style: TextStyle( | ||||||
|         ), |                 fontSize: 16, color: _disabledTextColor(context, enabled)), | ||||||
|       ), |           ).marginOnly(right: 10)), | ||||||
|       Spacer(flex: 1), |  | ||||||
|       Expanded( |       Expanded( | ||||||
|         flex: 10, |  | ||||||
|         child: TextField( |         child: TextField( | ||||||
|             controller: controller, |             controller: controller, | ||||||
|             enabled: enabled, |             enabled: enabled, | ||||||
|             obscureText: secure, |             obscureText: secure, | ||||||
|             decoration: InputDecoration( |             decoration: InputDecoration( | ||||||
|                 isDense: true, |                 isDense: true, | ||||||
|                 contentPadding: EdgeInsets.symmetric(vertical: 15), |                 border: OutlineInputBorder(), | ||||||
|  |                 contentPadding: EdgeInsets.fromLTRB(14, 15, 14, 15), | ||||||
|                 errorText: errorText.isNotEmpty ? errorText : null), |                 errorText: errorText.isNotEmpty ? errorText : null), | ||||||
|             style: TextStyle( |             style: TextStyle( | ||||||
|               color: _disabledTextColor(context, enabled), |               color: _disabledTextColor(context, enabled), | ||||||
|             )), |             )), | ||||||
|       ), |       ), | ||||||
|       Spacer(flex: 1), |  | ||||||
|     ], |     ], | ||||||
|   ); |   ).marginOnly(bottom: 8); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| // ignore: must_be_immutable | // ignore: must_be_immutable | ||||||
| @ -1856,12 +1853,11 @@ void changeSocks5Proxy() async { | |||||||
|             Row( |             Row( | ||||||
|               children: [ |               children: [ | ||||||
|                 ConstrainedBox( |                 ConstrainedBox( | ||||||
|                     constraints: const BoxConstraints(minWidth: 100), |                     constraints: const BoxConstraints(minWidth: 140), | ||||||
|                     child: Text('${translate("Hostname")}:') |                     child: Text( | ||||||
|                         .marginOnly(bottom: 16.0)), |                       '${translate("Hostname")}:', | ||||||
|                 const SizedBox( |                       textAlign: TextAlign.right, | ||||||
|                   width: 24.0, |                     ).marginOnly(right: 10)), | ||||||
|                 ), |  | ||||||
|                 Expanded( |                 Expanded( | ||||||
|                   child: TextField( |                   child: TextField( | ||||||
|                     decoration: InputDecoration( |                     decoration: InputDecoration( | ||||||
| @ -1872,19 +1868,15 @@ void changeSocks5Proxy() async { | |||||||
|                   ), |                   ), | ||||||
|                 ), |                 ), | ||||||
|               ], |               ], | ||||||
|             ), |             ).marginOnly(bottom: 8), | ||||||
|             const SizedBox( |  | ||||||
|               height: 8.0, |  | ||||||
|             ), |  | ||||||
|             Row( |             Row( | ||||||
|               children: [ |               children: [ | ||||||
|                 ConstrainedBox( |                 ConstrainedBox( | ||||||
|                     constraints: const BoxConstraints(minWidth: 100), |                     constraints: const BoxConstraints(minWidth: 140), | ||||||
|                     child: Text('${translate("Username")}:') |                     child: Text( | ||||||
|                         .marginOnly(bottom: 16.0)), |                       '${translate("Username")}:', | ||||||
|                 const SizedBox( |                       textAlign: TextAlign.right, | ||||||
|                   width: 24.0, |                     ).marginOnly(right: 10)), | ||||||
|                 ), |  | ||||||
|                 Expanded( |                 Expanded( | ||||||
|                   child: TextField( |                   child: TextField( | ||||||
|                     decoration: const InputDecoration( |                     decoration: const InputDecoration( | ||||||
| @ -1894,19 +1886,15 @@ void changeSocks5Proxy() async { | |||||||
|                   ), |                   ), | ||||||
|                 ), |                 ), | ||||||
|               ], |               ], | ||||||
|             ), |             ).marginOnly(bottom: 8), | ||||||
|             const SizedBox( |  | ||||||
|               height: 8.0, |  | ||||||
|             ), |  | ||||||
|             Row( |             Row( | ||||||
|               children: [ |               children: [ | ||||||
|                 ConstrainedBox( |                 ConstrainedBox( | ||||||
|                     constraints: const BoxConstraints(minWidth: 100), |                     constraints: const BoxConstraints(minWidth: 140), | ||||||
|                     child: Text('${translate("Password")}:') |                     child: Text( | ||||||
|                         .marginOnly(bottom: 16.0)), |                       '${translate("Password")}:', | ||||||
|                 const SizedBox( |                       textAlign: TextAlign.right, | ||||||
|                   width: 24.0, |                     ).marginOnly(right: 10)), | ||||||
|                 ), |  | ||||||
|                 Expanded( |                 Expanded( | ||||||
|                   child: Obx(() => TextField( |                   child: Obx(() => TextField( | ||||||
|                         obscureText: obscure.value, |                         obscureText: obscure.value, | ||||||
| @ -1921,10 +1909,7 @@ void changeSocks5Proxy() async { | |||||||
|                       )), |                       )), | ||||||
|                 ), |                 ), | ||||||
|               ], |               ], | ||||||
|             ), |             ).marginOnly(bottom: 8), | ||||||
|             const SizedBox( |  | ||||||
|               height: 8.0, |  | ||||||
|             ), |  | ||||||
|             Offstage( |             Offstage( | ||||||
|                 offstage: !isInProgress, child: const LinearProgressIndicator()) |                 offstage: !isInProgress, child: const LinearProgressIndicator()) | ||||||
|           ], |           ], | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user