@@ -61,63 +61,67 @@ class _LoginPageState extends State<LoginPage> {
6161 body: new Container (
6262 color: Theme .of (context).primaryColor,
6363 child: new Center (
64- child: new Card (
65- elevation: 5.0 ,
66- shape: new RoundedRectangleBorder (borderRadius: BorderRadius .all (Radius .circular (10.0 ))),
67- color: Color (GSYColors .cardWhite),
68- margin: const EdgeInsets .only (left: 30.0 , right: 30.0 ),
69- child: new Padding (
70- padding: new EdgeInsets .only (left: 30.0 , top: 40.0 , right: 30.0 , bottom: 0.0 ),
71- child: new Column (
72- mainAxisAlignment: MainAxisAlignment .center,
73- mainAxisSize: MainAxisSize .min,
74- children: < Widget > [
75- new Image (image: new AssetImage (GSYICons .DEFAULT_USER_ICON ), width: 90.0 , height: 90.0 ),
76- new Padding (padding: new EdgeInsets .all (10.0 )),
77- new GSYInputWidget (
78- hintText: CommonUtils .getLocale (context).login_username_hint_text,
79- iconData: GSYICons .LOGIN_USER ,
80- onChanged: (String value) {
81- _userName = value;
82- },
83- controller: userController,
84- ),
85- new Padding (padding: new EdgeInsets .all (10.0 )),
86- new GSYInputWidget (
87- hintText: CommonUtils .getLocale (context).login_password_hint_text,
88- iconData: GSYICons .LOGIN_PW ,
89- obscureText: true ,
90- onChanged: (String value) {
91- _password = value;
92- },
93- controller: pwController,
94- ),
95- new Padding (padding: new EdgeInsets .all (30.0 )),
96- new GSYFlexButton (
97- text: CommonUtils .getLocale (context).login_text,
98- color: Theme .of (context).primaryColor,
99- textColor: Color (GSYColors .textWhite),
100- onPress: () {
101- if (_userName == null || _userName.length == 0 ) {
102- return ;
103- }
104- if (_password == null || _password.length == 0 ) {
105- return ;
106- }
107- CommonUtils .showLoadingDialog (context);
108- UserDao .login (_userName.trim (), _password.trim (), store).then ((res) {
109- Navigator .pop (context);
110- if (res != null && res.result) {
111- new Future .delayed (const Duration (seconds: 1 ), () {
112- NavigatorUtils .goHome (context);
113- return true ;
64+ child: SafeArea (
65+ child: SingleChildScrollView (
66+ child: new Card (
67+ elevation: 5.0 ,
68+ shape: new RoundedRectangleBorder (borderRadius: BorderRadius .all (Radius .circular (10.0 ))),
69+ color: Color (GSYColors .cardWhite),
70+ margin: const EdgeInsets .only (left: 30.0 , right: 30.0 ),
71+ child: new Padding (
72+ padding: new EdgeInsets .only (left: 30.0 , top: 40.0 , right: 30.0 , bottom: 0.0 ),
73+ child: new Column (
74+ mainAxisAlignment: MainAxisAlignment .center,
75+ mainAxisSize: MainAxisSize .min,
76+ children: < Widget > [
77+ new Image (image: new AssetImage (GSYICons .DEFAULT_USER_ICON ), width: 90.0 , height: 90.0 ),
78+ new Padding (padding: new EdgeInsets .all (10.0 )),
79+ new GSYInputWidget (
80+ hintText: CommonUtils .getLocale (context).login_username_hint_text,
81+ iconData: GSYICons .LOGIN_USER ,
82+ onChanged: (String value) {
83+ _userName = value;
84+ },
85+ controller: userController,
86+ ),
87+ new Padding (padding: new EdgeInsets .all (10.0 )),
88+ new GSYInputWidget (
89+ hintText: CommonUtils .getLocale (context).login_password_hint_text,
90+ iconData: GSYICons .LOGIN_PW ,
91+ obscureText: true ,
92+ onChanged: (String value) {
93+ _password = value;
94+ },
95+ controller: pwController,
96+ ),
97+ new Padding (padding: new EdgeInsets .all (30.0 )),
98+ new GSYFlexButton (
99+ text: CommonUtils .getLocale (context).login_text,
100+ color: Theme .of (context).primaryColor,
101+ textColor: Color (GSYColors .textWhite),
102+ onPress: () {
103+ if (_userName == null || _userName.length == 0 ) {
104+ return ;
105+ }
106+ if (_password == null || _password.length == 0 ) {
107+ return ;
108+ }
109+ CommonUtils .showLoadingDialog (context);
110+ UserDao .login (_userName.trim (), _password.trim (), store).then ((res) {
111+ Navigator .pop (context);
112+ if (res != null && res.result) {
113+ new Future .delayed (const Duration (seconds: 1 ), () {
114+ NavigatorUtils .goHome (context);
115+ return true ;
116+ });
117+ }
114118 });
115- }
116- });
117- },
119+ },
120+ ),
121+ new Padding (padding: new EdgeInsets .all (30.0 )),
122+ ],
118123 ),
119- new Padding (padding: new EdgeInsets .all (30.0 )),
120- ],
124+ ),
121125 ),
122126 ),
123127 ),
0 commit comments