控制网页网址的全部跳转
This commit is contained in:
parent
172e30b2a3
commit
99ab6695a9
|
|
@ -220,34 +220,61 @@ class _ShowWebWidgetState extends State<ShowWebWidget> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// 跳转网址
|
/// 跳转网址
|
||||||
input(){
|
input() {
|
||||||
return Row(
|
return Row(
|
||||||
children: [
|
children: [
|
||||||
SizedBox(width: 400, child: TextField(style: const TextStyle(fontSize: 14),controller: urlController,)),
|
SizedBox(
|
||||||
TextButton(onPressed: (){
|
width: 400,
|
||||||
String url = urlController.text;
|
child: TextField(
|
||||||
// if (!url.startsWith("https://") ) {
|
style: const TextStyle(fontSize: 14),
|
||||||
// url = "https://$url";
|
controller: urlController,
|
||||||
// }
|
)),
|
||||||
widget.controller.loadUrl(url);
|
TextButton(
|
||||||
}, child: const Text('跳转',style: TextStyle(fontSize: 14),))
|
onPressed: () {
|
||||||
|
String url = urlController.text;
|
||||||
|
// if (!url.startsWith("https://") ) {
|
||||||
|
// url = "https://$url";
|
||||||
|
// }
|
||||||
|
widget.controller.loadUrl(url);
|
||||||
|
},
|
||||||
|
child: const Text(
|
||||||
|
'跳转',
|
||||||
|
style: TextStyle(fontSize: 14),
|
||||||
|
)),
|
||||||
|
TextButton(
|
||||||
|
onPressed: () {
|
||||||
|
String url = urlController.text;
|
||||||
|
|
||||||
|
widget.allLoadUrl(url);
|
||||||
|
},
|
||||||
|
child: const Text(
|
||||||
|
'全部跳转',
|
||||||
|
style: TextStyle(fontSize: 14),
|
||||||
|
)),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
ipSet(){
|
ipSet() {
|
||||||
ipController.text = SocketUtils.getInstance().url;
|
ipController.text = SocketUtils.getInstance().url;
|
||||||
return Row(
|
return Row(
|
||||||
children: [
|
children: [
|
||||||
SizedBox(width: 100, child: TextField(style: const TextStyle(fontSize: 14),controller: ipController,)),
|
SizedBox(
|
||||||
TextButton(onPressed: (){
|
width: 100,
|
||||||
SocketUtils.getInstance().url = ipController.text;
|
child: TextField(
|
||||||
SocketUtils.getInstance().connect();
|
style: const TextStyle(fontSize: 14),
|
||||||
}, child: const Text('保存服务器ip',style: TextStyle(fontSize: 14),))
|
controller: ipController,
|
||||||
|
)),
|
||||||
|
TextButton(
|
||||||
|
onPressed: () {
|
||||||
|
SocketUtils.getInstance().url = ipController.text;
|
||||||
|
SocketUtils.getInstance().connect();
|
||||||
|
},
|
||||||
|
child: const Text(
|
||||||
|
'保存服务器ip',
|
||||||
|
style: TextStyle(fontSize: 14),
|
||||||
|
))
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue