[英]How to create Row in dialog or alert dialog using flutter
I didn't test it but this should work,all you have to do is style the widgets in the Row widget according to the image you put我没有对其进行测试,但这应该可以,您所要做的就是根据您放置的图像设置 Row 小部件中的小部件样式
showAlertDialog(BuildContext context) {
AlertDialog alert = AlertDialog(
content: Container(
child: Row(
children:[
Expanded(
child: TextField(
decoration: InputDecoration(
hintText: "First Name",
),
),
),
Expanded(
child: TextField(
decoration: InputDecoration(
hintText: "Last Name",
),
),
),
]
),
),
);
// show the dialog
showDialog(
context: context,
builder: (BuildContext context) {
return alert;
},
);
}
For a column to form in an alert dialog box you have put the textfield in an expanded widget.对于要在警报对话框中形成的列,您已将文本字段放在展开的小部件中。
Row(children: [
Expanded(
child: TextField(),
),
SizedBox(width: 8.0,),
Expanded(
child: TextField(),
),
]),
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.