Skip to content

Commit

Permalink
Merge pull request #228 from xzchsia/master
Browse files Browse the repository at this point in the history
修正弹出键盘的时候,出现overFlow的现象
  • Loading branch information
CarGuo committed Jan 16, 2019
2 parents fa6dd45 + 2ff2fed commit cf8ac23
Showing 1 changed file with 59 additions and 55 deletions.
114 changes: 59 additions & 55 deletions lib/page/LoginPage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -61,63 +61,67 @@ class _LoginPageState extends State<LoginPage> {
body: new Container(
color: Theme.of(context).primaryColor,
child: new Center(
child: new Card(
elevation: 5.0,
shape: new RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(10.0))),
color: Color(GSYColors.cardWhite),
margin: const EdgeInsets.only(left:30.0, right: 30.0),
child: new Padding(
padding: new EdgeInsets.only(left: 30.0, top: 40.0, right: 30.0, bottom: 0.0),
child: new Column(
mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.min,
children: <Widget>[
new Image(image: new AssetImage(GSYICons.DEFAULT_USER_ICON), width: 90.0, height: 90.0),
new Padding(padding: new EdgeInsets.all(10.0)),
new GSYInputWidget(
hintText: CommonUtils.getLocale(context).login_username_hint_text,
iconData: GSYICons.LOGIN_USER,
onChanged: (String value) {
_userName = value;
},
controller: userController,
),
new Padding(padding: new EdgeInsets.all(10.0)),
new GSYInputWidget(
hintText: CommonUtils.getLocale(context).login_password_hint_text,
iconData: GSYICons.LOGIN_PW,
obscureText: true,
onChanged: (String value) {
_password = value;
},
controller: pwController,
),
new Padding(padding: new EdgeInsets.all(30.0)),
new GSYFlexButton(
text: CommonUtils.getLocale(context).login_text,
color: Theme.of(context).primaryColor,
textColor: Color(GSYColors.textWhite),
onPress: () {
if (_userName == null || _userName.length == 0) {
return;
}
if (_password == null || _password.length == 0) {
return;
}
CommonUtils.showLoadingDialog(context);
UserDao.login(_userName.trim(), _password.trim(), store).then((res) {
Navigator.pop(context);
if (res != null && res.result) {
new Future.delayed(const Duration(seconds: 1), () {
NavigatorUtils.goHome(context);
return true;
child: SafeArea(
child: SingleChildScrollView(
child: new Card(
elevation: 5.0,
shape: new RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(10.0))),
color: Color(GSYColors.cardWhite),
margin: const EdgeInsets.only(left:30.0, right: 30.0),
child: new Padding(
padding: new EdgeInsets.only(left: 30.0, top: 40.0, right: 30.0, bottom: 0.0),
child: new Column(
mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.min,
children: <Widget>[
new Image(image: new AssetImage(GSYICons.DEFAULT_USER_ICON), width: 90.0, height: 90.0),
new Padding(padding: new EdgeInsets.all(10.0)),
new GSYInputWidget(
hintText: CommonUtils.getLocale(context).login_username_hint_text,
iconData: GSYICons.LOGIN_USER,
onChanged: (String value) {
_userName = value;
},
controller: userController,
),
new Padding(padding: new EdgeInsets.all(10.0)),
new GSYInputWidget(
hintText: CommonUtils.getLocale(context).login_password_hint_text,
iconData: GSYICons.LOGIN_PW,
obscureText: true,
onChanged: (String value) {
_password = value;
},
controller: pwController,
),
new Padding(padding: new EdgeInsets.all(30.0)),
new GSYFlexButton(
text: CommonUtils.getLocale(context).login_text,
color: Theme.of(context).primaryColor,
textColor: Color(GSYColors.textWhite),
onPress: () {
if (_userName == null || _userName.length == 0) {
return;
}
if (_password == null || _password.length == 0) {
return;
}
CommonUtils.showLoadingDialog(context);
UserDao.login(_userName.trim(), _password.trim(), store).then((res) {
Navigator.pop(context);
if (res != null && res.result) {
new Future.delayed(const Duration(seconds: 1), () {
NavigatorUtils.goHome(context);
return true;
});
}
});
}
});
},
},
),
new Padding(padding: new EdgeInsets.all(30.0)),
],
),
new Padding(padding: new EdgeInsets.all(30.0)),
],
),
),
),
),
Expand Down

0 comments on commit cf8ac23

Please sign in to comment.