mirror of
https://github.com/GopeedLab/gopeed.git
synced 2026-11-18 22:33:42 +00:00
fix: adapt mobile proxy settings ui (#301)
This commit is contained in:
1 file changed
+37
-45
@@ -387,35 +387,33 @@ class SettingView extends GetView<SettingController> {
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
final items = <Widget>[
|
final scheme = SizedBox(
|
||||||
SizedBox(
|
width: 100,
|
||||||
width: 150,
|
child: DropdownButtonFormField<String>(
|
||||||
child: DropdownButtonFormField<String>(
|
value: proxy.scheme,
|
||||||
value: proxy.scheme,
|
onChanged: (value) async {
|
||||||
onChanged: (value) async {
|
if (value != null && value != proxy.scheme) {
|
||||||
if (value != null && value != proxy.scheme) {
|
proxy.scheme = value;
|
||||||
proxy.scheme = value;
|
|
||||||
|
|
||||||
await debounceSave();
|
await debounceSave();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
items: const [
|
items: const [
|
||||||
DropdownMenuItem<String>(
|
DropdownMenuItem<String>(
|
||||||
value: 'http',
|
value: 'http',
|
||||||
child: Text('HTTP'),
|
child: Text('HTTP'),
|
||||||
),
|
),
|
||||||
DropdownMenuItem<String>(
|
DropdownMenuItem<String>(
|
||||||
value: 'https',
|
value: 'https',
|
||||||
child: Text('HTTPS'),
|
child: Text('HTTPS'),
|
||||||
),
|
),
|
||||||
DropdownMenuItem<String>(
|
DropdownMenuItem<String>(
|
||||||
value: 'socks5',
|
value: 'socks5',
|
||||||
child: Text('SOCKS5'),
|
child: Text('SOCKS5'),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
)
|
);
|
||||||
];
|
|
||||||
|
|
||||||
final arr = proxy.host.split(':');
|
final arr = proxy.host.split(':');
|
||||||
var ip = '';
|
var ip = '';
|
||||||
@@ -438,10 +436,8 @@ class SettingView extends GetView<SettingController> {
|
|||||||
|
|
||||||
ipController.addListener(updateAddress);
|
ipController.addListener(updateAddress);
|
||||||
portController.addListener(updateAddress);
|
portController.addListener(updateAddress);
|
||||||
items.addAll([
|
final host = [
|
||||||
const Padding(padding: EdgeInsets.only(left: 20)),
|
Flexible(
|
||||||
SizedBox(
|
|
||||||
width: 150,
|
|
||||||
child: TextFormField(
|
child: TextFormField(
|
||||||
controller: ipController,
|
controller: ipController,
|
||||||
decoration: const InputDecoration(
|
decoration: const InputDecoration(
|
||||||
@@ -455,8 +451,7 @@ class SettingView extends GetView<SettingController> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
const Padding(padding: EdgeInsets.only(left: 10)),
|
const Padding(padding: EdgeInsets.only(left: 10)),
|
||||||
SizedBox(
|
Flexible(
|
||||||
width: 150,
|
|
||||||
child: TextFormField(
|
child: TextFormField(
|
||||||
controller: portController,
|
controller: portController,
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
@@ -470,14 +465,13 @@ class SettingView extends GetView<SettingController> {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
]);
|
];
|
||||||
|
|
||||||
final usrController = TextEditingController(text: proxy.usr);
|
final usrController = TextEditingController(text: proxy.usr);
|
||||||
final pwdController = TextEditingController(text: proxy.pwd);
|
final pwdController = TextEditingController(text: proxy.pwd);
|
||||||
|
|
||||||
final auth = [
|
final auth = [
|
||||||
SizedBox(
|
Flexible(
|
||||||
width: 150,
|
|
||||||
child: TextFormField(
|
child: TextFormField(
|
||||||
controller: usrController,
|
controller: usrController,
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
@@ -491,8 +485,7 @@ class SettingView extends GetView<SettingController> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
const Padding(padding: EdgeInsets.only(left: 10)),
|
const Padding(padding: EdgeInsets.only(left: 10)),
|
||||||
SizedBox(
|
Flexible(
|
||||||
width: 150,
|
|
||||||
child: TextFormField(
|
child: TextFormField(
|
||||||
controller: pwdController,
|
controller: pwdController,
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
@@ -513,8 +506,9 @@ class SettingView extends GetView<SettingController> {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: _addPadding([
|
children: _addPadding([
|
||||||
switcher,
|
switcher,
|
||||||
|
scheme,
|
||||||
Row(
|
Row(
|
||||||
children: items,
|
children: host,
|
||||||
),
|
),
|
||||||
Row(
|
Row(
|
||||||
children: auth,
|
children: auth,
|
||||||
@@ -534,7 +528,7 @@ class SettingView extends GetView<SettingController> {
|
|||||||
(Key key) {
|
(Key key) {
|
||||||
final items = <Widget>[
|
final items = <Widget>[
|
||||||
SizedBox(
|
SizedBox(
|
||||||
width: 150,
|
width: 80,
|
||||||
child: DropdownButtonFormField<String>(
|
child: DropdownButtonFormField<String>(
|
||||||
value: startCfg.value.network,
|
value: startCfg.value.network,
|
||||||
onChanged: Util.isDesktop()
|
onChanged: Util.isDesktop()
|
||||||
@@ -585,8 +579,7 @@ class SettingView extends GetView<SettingController> {
|
|||||||
portController.addListener(updateAddress);
|
portController.addListener(updateAddress);
|
||||||
items.addAll([
|
items.addAll([
|
||||||
const Padding(padding: EdgeInsets.only(left: 20)),
|
const Padding(padding: EdgeInsets.only(left: 20)),
|
||||||
SizedBox(
|
Flexible(
|
||||||
width: 150,
|
|
||||||
child: TextFormField(
|
child: TextFormField(
|
||||||
controller: ipController,
|
controller: ipController,
|
||||||
decoration: const InputDecoration(
|
decoration: const InputDecoration(
|
||||||
@@ -600,8 +593,7 @@ class SettingView extends GetView<SettingController> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
const Padding(padding: EdgeInsets.only(left: 10)),
|
const Padding(padding: EdgeInsets.only(left: 10)),
|
||||||
SizedBox(
|
Flexible(
|
||||||
width: 150,
|
|
||||||
child: TextFormField(
|
child: TextFormField(
|
||||||
controller: portController,
|
controller: portController,
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
|
|||||||
Reference in new issue
Block a user