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