Skip to content

Commit 6475470

Browse files
committed
登出功能
1 parent c81e487 commit 6475470

File tree

1 file changed

+20
-12
lines changed

1 file changed

+20
-12
lines changed

lib/widgets/Setting/SettingContent.dart

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import 'package:flutter_book/helpers/Adapt.dart';
33
import 'package:flutter_book/helpers/constants.dart';
44
import 'package:flutter_book/widgets/Mine/ListItem.dart';
55
import 'package:flutter_book/routers/application.dart';
6+
import 'package:flutter_book/containers/Login.dart';
67
import 'package:fluro/fluro.dart';
78

89
class SettingContent extends StatefulWidget {
@@ -91,18 +92,25 @@ class _SettingContentState extends State<SettingContent> {
9192
},
9293
);
9394
}).toList()),
94-
Container(
95-
margin: EdgeInsets.only(top: Adapt.height(120.0)),
96-
padding: EdgeInsets.symmetric(vertical: Adapt.height(14.0)),
97-
width: double.infinity,
98-
decoration: BoxDecoration(color: Color(AppColors.themeColorGray)),
99-
child: Text(
100-
"登出",
101-
textAlign: TextAlign.center,
102-
style: TextStyle(
103-
color: Color(AppColors.fontColor),
104-
fontSize: Adapt.px(20.0),
105-
fontWeight: FontWeight.w400),
95+
GestureDetector(
96+
onTap: () {
97+
Navigator.of(context).pushAndRemoveUntil(
98+
MaterialPageRoute(builder: (context) => Login()),
99+
(route) => route == null);
100+
},
101+
child: Container(
102+
margin: EdgeInsets.only(top: Adapt.height(120.0)),
103+
padding: EdgeInsets.symmetric(vertical: Adapt.height(14.0)),
104+
width: double.infinity,
105+
decoration: BoxDecoration(color: Color(AppColors.themeColorGray)),
106+
child: Text(
107+
"登出",
108+
textAlign: TextAlign.center,
109+
style: TextStyle(
110+
color: Color(AppColors.fontColor),
111+
fontSize: Adapt.px(20.0),
112+
fontWeight: FontWeight.w400),
113+
),
106114
),
107115
),
108116
],

0 commit comments

Comments
 (0)