@@ -39,92 +39,102 @@ class HomeDrawer extends StatelessWidget {
3939 User user = store.state.userInfo;
4040 return new Drawer (
4141 //侧边栏按钮Drawer
42- child: new ListView (
43- children: < Widget > [
44- new UserAccountsDrawerHeader (
45- //Material内置控件
46- accountName: new Text (
47- user.login ?? "---" ,
48- style: GSYConstant .largeTextWhite,
49- ),
50- accountEmail: new Text (
51- user.email ?? user.name ?? "---" ,
52- style: GSYConstant .subNormalText,
53- ),
54- //用户名
55- //用户邮箱
56- currentAccountPicture: new GestureDetector (
57- //用户头像
58- onTap: () {},
59- child: new CircleAvatar (
60- //圆形图标控件
61- backgroundImage: new NetworkImage (user.avatar_url ?? GSYICons .DEFAULT_REMOTE_PIC ),
62- ),
63- ),
64- decoration: new BoxDecoration (
65- //用一个BoxDecoration装饰器提供背景图片
66- color: Color (GSYColors .primaryValue),
42+ child: new Container (
43+ color: Color (GSYColors .primaryValue),
44+ child: new SingleChildScrollView (
45+ child: new Container (
46+ height: MediaQuery .of (context).size.height,
47+ color: Color (GSYColors .white),
48+ child: new Column (
49+ children: < Widget > [
50+ new UserAccountsDrawerHeader (
51+ //Material内置控件
52+ accountName: new Text (
53+ user.login ?? "---" ,
54+ style: GSYConstant .largeTextWhite,
55+ ),
56+ accountEmail: new Text (
57+ user.email ?? user.name ?? "---" ,
58+ style: GSYConstant .subNormalText,
59+ ),
60+ //用户名
61+ //用户邮箱
62+ currentAccountPicture: new GestureDetector (
63+ //用户头像
64+ onTap: () {},
65+ child: new CircleAvatar (
66+ //圆形图标控件
67+ backgroundImage: new NetworkImage (user.avatar_url ?? GSYICons .DEFAULT_REMOTE_PIC ),
68+ ),
69+ ),
70+ decoration: new BoxDecoration (
71+ //用一个BoxDecoration装饰器提供背景图片
72+ color: Color (GSYColors .primaryValue),
73+ ),
74+ ),
75+ new ListTile (
76+ title: new Text (
77+ GSYStrings .home_reply,
78+ style: GSYConstant .normalText,
79+ ),
80+ onTap: () {
81+ String content = "" ;
82+ CommonUtils .showEditDialog (context, GSYStrings .home_reply, (title) {}, (res) {
83+ content = res;
84+ }, () {
85+ if (content == null || content.length == 0 ) {
86+ return ;
87+ }
88+ CommonUtils .showLoadingDialog (context);
89+ IssueDao
90+ .createIssueDao ("CarGuo" , "GSYGithubAppFlutter" , {"title" : GSYStrings .home_reply, "body" : content}).then ((result) {
91+ Navigator .pop (context);
92+ Navigator .pop (context);
93+ });
94+ }, titleController: new TextEditingController (), valueController: new TextEditingController (), needTitle: false );
95+ }),
96+ new ListTile (
97+ title: new Text (
98+ GSYStrings .home_history,
99+ style: GSYConstant .normalText,
100+ ),
101+ onTap: () {
102+ NavigatorUtils .gotoCommonList (context, GSYStrings .home_history, "repository" , "history" , userName: "" , reposName: "" );
103+ }),
104+ new ListTile (
105+ title: new Text (
106+ GSYStrings .home_check_update,
107+ style: GSYConstant .normalText,
108+ ),
109+ onTap: () {
110+ ReposDao .getNewsVersion (context, true );
111+ }),
112+ new ListTile (
113+ title: new Text (
114+ GSYStrings .home_about,
115+ style: GSYConstant .normalText,
116+ ),
117+ onTap: () {
118+ GetVersion .projectVersion.then ((value) {
119+ showAboutDialog (context, value);
120+ });
121+ }),
122+ new ListTile (
123+ title: new GSYFlexButton (
124+ text: GSYStrings .Login_out ,
125+ color: Colors .redAccent,
126+ textColor: Color (GSYColors .textWhite),
127+ onPress: () {
128+ UserDao .clearAll (store);
129+ EventDao .clearEvent (store);
130+ NavigatorUtils .goLogin (context);
131+ },
132+ ),
133+ onTap: () {}),
134+ ],
67135 ),
68136 ),
69- new ListTile (
70- title: new Text (
71- GSYStrings .home_reply,
72- style: GSYConstant .normalText,
73- ),
74- onTap: () {
75- String content = "" ;
76- CommonUtils .showEditDialog (context, GSYStrings .home_reply, (title) {}, (res) {
77- content = res;
78- }, () {
79- if (content == null || content.length == 0 ) {
80- return ;
81- }
82- CommonUtils .showLoadingDialog (context);
83- IssueDao .createIssueDao ("CarGuo" , "GSYGithubAppFlutter" , {"title" : GSYStrings .home_reply, "body" : content}).then ((result) {
84- Navigator .pop (context);
85- Navigator .pop (context);
86- });
87- }, titleController: new TextEditingController (), valueController: new TextEditingController (), needTitle: false );
88- }),
89- new ListTile (
90- title: new Text (
91- GSYStrings .home_history,
92- style: GSYConstant .normalText,
93- ),
94- onTap: () {
95- NavigatorUtils .gotoCommonList (context, GSYStrings .home_history, "repository" , "history" , userName: "" , reposName: "" );
96- }),
97- new ListTile (
98- title: new Text (
99- GSYStrings .home_check_update,
100- style: GSYConstant .normalText,
101- ),
102- onTap: () {
103- ReposDao .getNewsVersion (context, true );
104- }),
105- new ListTile (
106- title: new Text (
107- GSYStrings .home_about,
108- style: GSYConstant .normalText,
109- ),
110- onTap: () {
111- GetVersion .projectVersion.then ((value) {
112- showAboutDialog (context, value);
113- });
114- }),
115- new ListTile (
116- title: new GSYFlexButton (
117- text: GSYStrings .Login_out ,
118- color: Colors .redAccent,
119- textColor: Color (GSYColors .textWhite),
120- onPress: () {
121- UserDao .clearAll (store);
122- EventDao .clearEvent (store);
123- NavigatorUtils .goLogin (context);
124- },
125- ),
126- onTap: () {}),
127- ],
137+ ),
128138 ),
129139 );
130140 },
0 commit comments