@@ -5,6 +5,7 @@ import 'package:flutter_redux/flutter_redux.dart';
55import 'package:gsy_github_app_flutter/common/config/config.dart' ;
66import 'package:gsy_github_app_flutter/common/dao/user_dao.dart' ;
77import 'package:gsy_github_app_flutter/common/local/local_storage.dart' ;
8+ import 'package:gsy_github_app_flutter/common/localization/default_localizations.dart' ;
89import 'package:gsy_github_app_flutter/common/redux/gsy_state.dart' ;
910import 'package:gsy_github_app_flutter/common/style/gsy_style.dart' ;
1011import 'package:gsy_github_app_flutter/common/utils/common_utils.dart' ;
@@ -69,19 +70,25 @@ class _LoginPageState extends State<LoginPage> {
6970 child: SingleChildScrollView (
7071 child: new Card (
7172 elevation: 5.0 ,
72- shape: new RoundedRectangleBorder (borderRadius: BorderRadius .all (Radius .circular (10.0 ))),
73+ shape: new RoundedRectangleBorder (
74+ borderRadius: BorderRadius .all (Radius .circular (10.0 ))),
7375 color: Color (GSYColors .cardWhite),
74- margin: const EdgeInsets .only (left: 30.0 , right: 30.0 ),
76+ margin: const EdgeInsets .only (left: 30.0 , right: 30.0 ),
7577 child: new Padding (
76- padding: new EdgeInsets .only (left: 30.0 , top: 40.0 , right: 30.0 , bottom: 0.0 ),
78+ padding: new EdgeInsets .only (
79+ left: 30.0 , top: 40.0 , right: 30.0 , bottom: 0.0 ),
7780 child: new Column (
7881 mainAxisAlignment: MainAxisAlignment .center,
7982 mainAxisSize: MainAxisSize .min,
8083 children: < Widget > [
81- new Image (image: new AssetImage (GSYICons .DEFAULT_USER_ICON ), width: 90.0 , height: 90.0 ),
84+ new Image (
85+ image: new AssetImage (GSYICons .DEFAULT_USER_ICON ),
86+ width: 90.0 ,
87+ height: 90.0 ),
8288 new Padding (padding: new EdgeInsets .all (10.0 )),
8389 new GSYInputWidget (
84- hintText: CommonUtils .getLocale (context).login_username_hint_text,
90+ hintText: CommonUtils .getLocale (context)
91+ .login_username_hint_text,
8592 iconData: GSYICons .LOGIN_USER ,
8693 onChanged: (String value) {
8794 _userName = value;
@@ -90,7 +97,8 @@ class _LoginPageState extends State<LoginPage> {
9097 ),
9198 new Padding (padding: new EdgeInsets .all (10.0 )),
9299 new GSYInputWidget (
93- hintText: CommonUtils .getLocale (context).login_password_hint_text,
100+ hintText: CommonUtils .getLocale (context)
101+ .login_password_hint_text,
94102 iconData: GSYICons .LOGIN_PW ,
95103 obscureText: true ,
96104 onChanged: (String value) {
@@ -111,18 +119,32 @@ class _LoginPageState extends State<LoginPage> {
111119 return ;
112120 }
113121 CommonUtils .showLoadingDialog (context);
114- UserDao .login (_userName.trim (), _password.trim (), store).then ((res) {
122+ UserDao .login (
123+ _userName.trim (), _password.trim (), store)
124+ .then ((res) {
115125 Navigator .pop (context);
116126 if (res != null && res.result) {
117- new Future .delayed (const Duration (seconds: 1 ), () {
127+ new Future .delayed (const Duration (seconds: 1 ),
128+ () {
118129 NavigatorUtils .goHome (context);
119130 return true ;
120131 });
121132 }
122133 });
123134 },
124135 ),
125- new Padding (padding: new EdgeInsets .all (30.0 )),
136+ new Padding (padding: new EdgeInsets .all (15.0 )),
137+ InkWell (
138+ onTap: () {
139+ CommonUtils .showLanguageDialog (context, store);
140+ },
141+ child: Text (
142+ CommonUtils .getLocale (context).switch_language,
143+ style: TextStyle (
144+ color: Color (GSYColors .subTextColor)),
145+ ),
146+ ),
147+ new Padding (padding: new EdgeInsets .all (15.0 )),
126148 ],
127149 ),
128150 ),
0 commit comments