@@ -63,7 +63,6 @@ class HomeDrawer extends StatelessWidget {
6363 }, height: 150.0 );
6464 }
6565
66-
6766 @override
6867 Widget build (BuildContext context) {
6968 return new StoreBuilder <GSYState >(
@@ -76,120 +75,125 @@ class HomeDrawer extends StatelessWidget {
7675 color: store.state.themeData.primaryColor,
7776 child: new SingleChildScrollView (
7877 ///item 背景
79- child: new Container (
78+ child: Container (
8079 constraints: new BoxConstraints (minHeight: MediaQuery .of (context).size.height),
81- color: Color (GSYColors .white),
82- child: new Column (
83- children: < Widget > [
84- new UserAccountsDrawerHeader (
85- //Material内置控件
86- accountName: new Text (
87- user.login ?? "---" ,
88- style: GSYConstant .largeTextWhite,
89- ),
90- accountEmail: new Text (
91- user.email ?? user.name ?? "---" ,
92- style: GSYConstant .normalTextLight,
93- ),
94- //用户名
95- //用户邮箱
96- currentAccountPicture: new GestureDetector (
97- //用户头像
98- onTap: () {},
99- child: new CircleAvatar (
100- //圆形图标控件
101- backgroundImage: new NetworkImage (user.avatar_url ?? GSYICons .DEFAULT_REMOTE_PIC ),
80+ child: new Material (
81+ color: Color (GSYColors .white),
82+ child: new Column (
83+ children: < Widget > [
84+ new UserAccountsDrawerHeader (
85+ //Material内置控件
86+ accountName: new Text (
87+ user.login ?? "---" ,
88+ style: GSYConstant .largeTextWhite,
10289 ),
103- ),
104- decoration: new BoxDecoration (
105- //用一个BoxDecoration装饰器提供背景图片
106- color: store.state.themeData.primaryColor,
107- ),
108- ),
109- new ListTile (
110- title: new Text (
111- CommonUtils .getLocale (context).home_reply,
112- style: GSYConstant .normalText,
113- ),
114- onTap: () {
115- String content = "" ;
116- CommonUtils .showEditDialog (context, CommonUtils .getLocale (context).home_reply, (title) {}, (res) {
117- content = res;
118- }, () {
119- if (content == null || content.length == 0 ) {
120- return ;
121- }
122- CommonUtils .showLoadingDialog (context);
123- IssueDao .createIssueDao ("CarGuo" , "GSYGithubAppFlutter" , {"title" : CommonUtils .getLocale (context).home_reply, "body" : content}).then ((result) {
124- Navigator .pop (context);
125- Navigator .pop (context);
126- });
127- }, titleController: new TextEditingController (), valueController: new TextEditingController (), needTitle: false );
128- }),
129- new ListTile (
130- title: new Text (
131- CommonUtils .getLocale (context).home_history,
132- style: GSYConstant .normalText,
90+ accountEmail: new Text (
91+ user.email ?? user.name ?? "---" ,
92+ style: GSYConstant .normalTextLight,
13393 ),
134- onTap: () {
135- NavigatorUtils .gotoCommonList (context, CommonUtils .getLocale (context).home_history, "repository" , "history" , userName: "" , reposName: "" );
136- }),
137- new ListTile (
138- title: new Text (
139- CommonUtils .getLocale (context).home_user_info,
140- style: GSYConstant .normalText,
94+ //用户名
95+ //用户邮箱
96+ currentAccountPicture: new GestureDetector (
97+ //用户头像
98+ onTap: () {},
99+ child: new CircleAvatar (
100+ //圆形图标控件
101+ backgroundImage: new NetworkImage (user.avatar_url ?? GSYICons .DEFAULT_REMOTE_PIC ),
102+ ),
141103 ),
142- onTap: () {
143- NavigatorUtils .gotoUserProfileInfo (context);
144- }),
145- new ListTile (
146- title: new Text (
147- CommonUtils .getLocale (context).home_change_theme,
148- style: GSYConstant .normalText,
104+ decoration: new BoxDecoration (
105+ //用一个BoxDecoration装饰器提供背景图片
106+ color: store.state.themeData.primaryColor,
149107 ),
150- onTap: () {
151- showThemeDialog (context, store);
152- }),
153- new ListTile (
154- title: new Text (
155- CommonUtils .getLocale (context).home_change_language,
156- style: GSYConstant .normalText,
157- ),
158- onTap: () {
159- showLanguageDialog (context, store);
160- }),
161- new ListTile (
162- title: new Text (
163- CommonUtils .getLocale (context).home_check_update,
164- style: GSYConstant .normalText,
165- ),
166- onTap: () {
167- ReposDao .getNewsVersion (context, true );
168- }),
169- new ListTile (
170- title: new Text (
171- GSYLocalizations .of (context).currentLocalized.home_about,
172- style: GSYConstant .normalText,
173- ),
174- onTap: () {
175- GetVersion .projectVersion.then ((value) {
176- showAboutDialog (context, value);
177- });
178- }),
179- new ListTile (
180- title: new GSYFlexButton (
181- text: CommonUtils .getLocale (context).Login_out ,
182- color: Colors .redAccent,
183- textColor: Color (GSYColors .textWhite),
184- onPress: () {
185- UserDao .clearAll (store);
186- EventDao .clearEvent (store);
187- SqlManager .close ();
188- NavigatorUtils .goLogin (context);
189- },
190- ),
191- onTap: () {}),
192- ],
108+ ),
109+ new ListTile (
110+ title: new Text (
111+ CommonUtils .getLocale (context).home_reply,
112+ style: GSYConstant .normalText,
113+ ),
114+ onTap: () {
115+ String content = "" ;
116+ CommonUtils .showEditDialog (context, CommonUtils .getLocale (context).home_reply, (title) {}, (res) {
117+ content = res;
118+ }, () {
119+ if (content == null || content.length == 0 ) {
120+ return ;
121+ }
122+ CommonUtils .showLoadingDialog (context);
123+ IssueDao .createIssueDao (
124+ "CarGuo" , "GSYGithubAppFlutter" , {"title" : CommonUtils .getLocale (context).home_reply, "body" : content})
125+ .then ((result) {
126+ Navigator .pop (context);
127+ Navigator .pop (context);
128+ });
129+ }, titleController: new TextEditingController (), valueController: new TextEditingController (), needTitle: false );
130+ }),
131+ new ListTile (
132+ title: new Text (
133+ CommonUtils .getLocale (context).home_history,
134+ style: GSYConstant .normalText,
135+ ),
136+ onTap: () {
137+ NavigatorUtils .gotoCommonList (context, CommonUtils .getLocale (context).home_history, "repository" , "history" ,
138+ userName: "" , reposName: "" );
139+ }),
140+ new ListTile (
141+ title: new Text (
142+ CommonUtils .getLocale (context).home_user_info,
143+ style: GSYConstant .normalText,
144+ ),
145+ onTap: () {
146+ NavigatorUtils .gotoUserProfileInfo (context);
147+ }),
148+ new ListTile (
149+ title: new Text (
150+ CommonUtils .getLocale (context).home_change_theme,
151+ style: GSYConstant .normalText,
152+ ),
153+ onTap: () {
154+ showThemeDialog (context, store);
155+ }),
156+ new ListTile (
157+ title: new Text (
158+ CommonUtils .getLocale (context).home_change_language,
159+ style: GSYConstant .normalText,
160+ ),
161+ onTap: () {
162+ showLanguageDialog (context, store);
163+ }),
164+ new ListTile (
165+ title: new Text (
166+ CommonUtils .getLocale (context).home_check_update,
167+ style: GSYConstant .normalText,
168+ ),
169+ onTap: () {
170+ ReposDao .getNewsVersion (context, true );
171+ }),
172+ new ListTile (
173+ title: new Text (
174+ GSYLocalizations .of (context).currentLocalized.home_about,
175+ style: GSYConstant .normalText,
176+ ),
177+ onTap: () {
178+ GetVersion .projectVersion.then ((value) {
179+ showAboutDialog (context, value);
180+ });
181+ }),
182+ new ListTile (
183+ title: new GSYFlexButton (
184+ text: CommonUtils .getLocale (context).Login_out ,
185+ color: Colors .redAccent,
186+ textColor: Color (GSYColors .textWhite),
187+ onPress: () {
188+ UserDao .clearAll (store);
189+ EventDao .clearEvent (store);
190+ SqlManager .close ();
191+ NavigatorUtils .goLogin (context);
192+ },
193+ ),
194+ onTap: () {}),
195+ ],
196+ ),
193197 ),
194198 ),
195199 ),
0 commit comments