|
|
|
@ -25,6 +25,8 @@ class MyHomePage extends StatefulWidget {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class _MyHomePageState extends State<MyHomePage> {
|
|
|
|
|
TextEditingController _textController =
|
|
|
|
|
TextEditingController(text: 'https://');
|
|
|
|
|
@override
|
|
|
|
|
void initState() {
|
|
|
|
|
super.initState();
|
|
|
|
@ -32,26 +34,39 @@ class _MyHomePageState extends State<MyHomePage> {
|
|
|
|
|
NetTool.dio.get("https://192.168.31.255:8888");
|
|
|
|
|
NetTool.dio.get("https://www.baidu.com", queryParameters: {'test': 'test'});
|
|
|
|
|
NetTool.dio.get("https://www.baidu.com/ahefbawfbe.html");
|
|
|
|
|
NetTool.dio.post(
|
|
|
|
|
"https://www.baidu.com/ahefbawfbe.html",
|
|
|
|
|
data: FormData.fromMap({'test': 'test'}),
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
NetTool.dio.post("https://www.baidu.com/ahefbawfbe.html",
|
|
|
|
|
data: FormData.fromMap({'test': 'test'}));
|
|
|
|
|
NetTool.dio.get(
|
|
|
|
|
"https://www.baidu.com/img/PCtm_d9c8750bed0b3c7d089fa7d55720d6cf.png");
|
|
|
|
|
PowerLogger.start(context);
|
|
|
|
|
LoggerData.addData('TEST');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
void dispose() {
|
|
|
|
|
_textController?.dispose();
|
|
|
|
|
super.dispose();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
return Scaffold(
|
|
|
|
|
appBar: AppBar(
|
|
|
|
|
title: Text(widget.title),
|
|
|
|
|
),
|
|
|
|
|
body: Container(
|
|
|
|
|
padding: EdgeInsets.all(10),
|
|
|
|
|
alignment: Alignment.center,
|
|
|
|
|
child: TextField(
|
|
|
|
|
controller: _textController,
|
|
|
|
|
decoration: InputDecoration(
|
|
|
|
|
filled: true,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
floatingActionButton: FloatingActionButton(
|
|
|
|
|
onPressed: () {
|
|
|
|
|
NetTool.dio.get("https://www.baidu.com");
|
|
|
|
|
NetTool.dio.get(_textController.text);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|