@@ -14,7 +14,7 @@ class MyApp extends StatefulWidget {
14
14
15
15
class _MyAppState extends State <MyApp > {
16
16
List <RouteItem > items;
17
- String _ip = '192.168.31.152' ;
17
+ String _serverAddress = '192.168.31.152' ;
18
18
SharedPreferences prefs;
19
19
20
20
@override
@@ -55,7 +55,7 @@ class _MyAppState extends State<MyApp> {
55
55
_initData () async {
56
56
prefs = await SharedPreferences .getInstance ();
57
57
setState (() {
58
- _ip = prefs.getString ('ip ' ) ?? '' ;
58
+ _serverAddress = prefs.getString ('server ' ) ?? '' ;
59
59
});
60
60
}
61
61
@@ -78,31 +78,31 @@ class _MyAppState extends State<MyApp> {
78
78
context: context,
79
79
builder: (BuildContext context) {
80
80
return SimpleDialog (
81
- title: const Text ('Please input server ip ' ),
81
+ title: const Text ('Please input server address. ' ),
82
82
children: < Widget > [
83
83
TextField (
84
84
onChanged: (String text) {
85
85
setState (() {
86
- _ip = text;
86
+ _serverAddress = text;
87
87
});
88
88
},
89
89
decoration: InputDecoration (
90
- hintText: _ip ,
90
+ hintText: _serverAddress ,
91
91
),
92
92
textAlign: TextAlign .center,
93
93
),
94
94
SimpleDialogOption (
95
95
onPressed: () {},
96
96
child: RaisedButton (
97
97
onPressed: () {
98
- prefs.setString ('ip ' , _ip );
98
+ prefs.setString ('server ' , _serverAddress );
99
99
Navigator .push (
100
100
context,
101
101
MaterialPageRoute (
102
102
builder: (BuildContext context) =>
103
- CallSample (ip: _ip )));
103
+ CallSample (ip: _serverAddress )));
104
104
},
105
- child: const Text ('connect server ' ),
105
+ child: const Text ('Connect Server ' ),
106
106
),
107
107
),
108
108
],
0 commit comments