Flutter中Row中不能直接使用textfield控件
解决方案class LogingUi extends StatelessWidget {@overrideWidget build(BuildContext context) {var size = MediaQuery.of(context).size;// TODO: implement buildreturn new Stack(...
·
解决方案
class LogingUi extends StatelessWidget {
@override
Widget build(BuildContext context) {
var size = MediaQuery.of(context).size;
// TODO: implement build
return new Stack(
fit: StackFit.loose,
children: <Widget>[
new Container(
color: Colors.white,
width: size.width,
height: size.height,
),
new Column(
mainAxisSize: MainAxisSize.max,
children: <Widget>[
new Container(
padding: EdgeInsets.all(30),
),
new Row(
mainAxisAlignment: MainAxisAlignment.center, //对其方式
children: <Widget>[
new Image.asset(
"images/login_logo.png",
width: 119,
height: 151,
fit: BoxFit.fill,
),
],
),
new Row(
children: <Widget>[
new Expanded(
child: new TextField(
//相当于Android属性hint
decoration: new InputDecoration(
hintText: "用户名",
)))
],
)
],
),
],
);
}
}更多推荐

所有评论(0)