|
|
@@ -3,6 +3,8 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
|
import 'my_page/revise_password_page.dart';
|
|
|
import 'package:flutter_picker/flutter_picker.dart';
|
|
|
import 'dart:convert';
|
|
|
+import '../showDialog.dart';
|
|
|
+import '../login_page.dart';
|
|
|
|
|
|
class MyPage extends StatefulWidget {
|
|
|
final Widget child;
|
|
|
@@ -41,13 +43,18 @@ class _MyPageState extends State < MyPage > with AutomaticKeepAliveClientMixin {
|
|
|
), ),
|
|
|
centerTitle: true,
|
|
|
backgroundColor: Color.fromRGBO(64, 98, 254, 1),
|
|
|
+ actions: < Widget > [
|
|
|
+ IconButton(
|
|
|
+ icon: Icon(Icons.arrow_forward, color: Colors.white, )
|
|
|
+ )
|
|
|
+ ],
|
|
|
),
|
|
|
body: Container(
|
|
|
color: Color.fromRGBO(246, 246, 254, 1),
|
|
|
child: Column(
|
|
|
children: < Widget > [
|
|
|
_avatarWidget(),
|
|
|
- _funWrapWidget(check, context)
|
|
|
+ _funWrapWidget(check, context),
|
|
|
],
|
|
|
),
|
|
|
),
|
|
|
@@ -86,7 +93,8 @@ class _MyPageState extends State < MyPage > with AutomaticKeepAliveClientMixin {
|
|
|
children: < Widget > [
|
|
|
_switchSite(context),
|
|
|
_passWordWidget(),
|
|
|
- _linkPrint(check)
|
|
|
+ _linkPrint(check),
|
|
|
+ _quitWidget(context)
|
|
|
],
|
|
|
),
|
|
|
);
|
|
|
@@ -158,19 +166,19 @@ class _MyPageState extends State < MyPage > with AutomaticKeepAliveClientMixin {
|
|
|
adapter: PickerDataAdapter < String > (pickerdata: new JsonDecoder().convert('["回龙观","草桥","丰台"]')),
|
|
|
height: ScreenUtil.getInstance().setHeight(450),
|
|
|
confirmText: '确定',
|
|
|
- confirmTextStyle: TextStyle(fontSize: ScreenUtil.getInstance().setSp(30),color: Color.fromRGBO(64,98,254,1)),
|
|
|
+ confirmTextStyle: TextStyle(fontSize: ScreenUtil.getInstance().setSp(30), color: Color.fromRGBO(64, 98, 254, 1)),
|
|
|
cancelText: '取消',
|
|
|
- cancelTextStyle: TextStyle(fontSize: ScreenUtil.getInstance().setSp(30),color: Color.fromRGBO(153,153,153,1)),
|
|
|
- headercolor: Color.fromRGBO(245,245,245,1),
|
|
|
+ cancelTextStyle: TextStyle(fontSize: ScreenUtil.getInstance().setSp(30), color: Color.fromRGBO(153, 153, 153, 1)),
|
|
|
+ headercolor: Color.fromRGBO(245, 245, 245, 1),
|
|
|
itemExtent: ScreenUtil.getInstance().setHeight(80),
|
|
|
- textStyle: TextStyle(fontSize: ScreenUtil.getInstance().setSp(30),color: Color.fromRGBO(42,42,42,1)),
|
|
|
+ textStyle: TextStyle(fontSize: ScreenUtil.getInstance().setSp(30), color: Color.fromRGBO(42, 42, 42, 1)),
|
|
|
changeToFirst: true,
|
|
|
hideHeader: false,
|
|
|
onConfirm: (Picker picker, List value) {
|
|
|
print(value.toString());
|
|
|
print(picker.adapter);
|
|
|
setState(() {
|
|
|
- _siteName = picker.adapter.text+'站点';
|
|
|
+ _siteName = picker.adapter.text + '站点';
|
|
|
});
|
|
|
}
|
|
|
).showModal(this.context); //_scaffoldKey.currentState);
|
|
|
@@ -274,6 +282,51 @@ class _MyPageState extends State < MyPage > with AutomaticKeepAliveClientMixin {
|
|
|
)
|
|
|
);
|
|
|
}
|
|
|
+
|
|
|
+ Widget _quitWidget(BuildContext context) {
|
|
|
+ return InkWell(
|
|
|
+ child: Container(
|
|
|
+ height: ScreenUtil.getInstance().setHeight(90),
|
|
|
+ color: Colors.white,
|
|
|
+ padding: EdgeInsets.fromLTRB(ScreenUtil.getInstance().setHeight(30), 0, 0, 0),
|
|
|
+ margin: EdgeInsets.only(top: ScreenUtil.getInstance().setHeight(20)),
|
|
|
+ child: Column(
|
|
|
+ children: < Widget > [
|
|
|
+ Expanded(
|
|
|
+ child: Center(
|
|
|
+ child: Row(
|
|
|
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
+ children: < Widget > [
|
|
|
+ Text('退出', style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(30), color: Color.fromRGBO(74, 74, 74, 1)), ),
|
|
|
+ Icon(Icons.keyboard_arrow_right, color: Color.fromRGBO(199, 199, 204, 1))
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ )
|
|
|
+ ],
|
|
|
+ )
|
|
|
+ ),
|
|
|
+ onTap: (){
|
|
|
+ showDialog < Null > (
|
|
|
+ context: context, //BuildContext对象
|
|
|
+ barrierDismissible: false,
|
|
|
+ builder: (BuildContext context) {
|
|
|
+ return new LoadingDialog( //调用对话框
|
|
|
+ text:'确认退出?',childCallback: (val){
|
|
|
+ if(val){
|
|
|
+ Navigator.pushReplacement(context, MaterialPageRoute(builder: (context){
|
|
|
+ return LoginPage();
|
|
|
+ }));
|
|
|
+ }else{
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ );
|
|
|
+ });
|
|
|
+ },
|
|
|
+ );
|
|
|
+
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
|