|
@@ -1,3 +1,6 @@
|
|
1
|
+import 'package:get/get.dart';
|
|
2
|
+import 'package:get_storage/get_storage.dart';
|
|
3
|
+
|
1
|
4
|
import './widgets/OtherColumn.dart';
|
2
|
5
|
import './widgets/UserAddress.dart';
|
3
|
6
|
import './widgets/UserInfo.dart';
|
|
@@ -12,6 +15,7 @@ class MainPage extends StatefulWidget {
|
12
|
15
|
}
|
13
|
16
|
|
14
|
17
|
class _MainPageState extends State<MainPage> {
|
|
18
|
+ GetStorage box = GetStorage();
|
15
|
19
|
@override
|
16
|
20
|
Widget build(BuildContext context) {
|
17
|
21
|
return Container(
|
|
@@ -41,8 +45,27 @@ class _MainPageState extends State<MainPage> {
|
41
|
45
|
height: 49.h,
|
42
|
46
|
child: ElevatedButton(
|
43
|
47
|
onPressed: () {
|
44
|
|
- // _handelSubmit();
|
45
|
|
- print('用户点击了支付啊阿松大撒地方');
|
|
48
|
+ showDialog(
|
|
49
|
+ context: context,
|
|
50
|
+ builder: (context) {
|
|
51
|
+ return AlertDialog(
|
|
52
|
+ content: Text("您确定退出登录吗?"),
|
|
53
|
+ actions: <Widget>[
|
|
54
|
+ TextButton(
|
|
55
|
+ child: Text("取消"),
|
|
56
|
+ onPressed: () {
|
|
57
|
+ Navigator.pop(context, 'Cancle');
|
|
58
|
+ },
|
|
59
|
+ ),
|
|
60
|
+ TextButton(
|
|
61
|
+ child: Text("确定"),
|
|
62
|
+ onPressed: () {
|
|
63
|
+ Navigator.pop(context, "Ok");
|
|
64
|
+ box.remove('token');
|
|
65
|
+ Get.offNamed('/login');
|
|
66
|
+ })
|
|
67
|
+ ]);
|
|
68
|
+ });
|
46
|
69
|
},
|
47
|
70
|
child: const Text(
|
48
|
71
|
"退出登陆",
|