我对扑打有疑问。 我需要在屏幕上方填充一个数据表。
我尝试将dataTable添加到Flex小部件中,但没有得到更改。
当我设置容器的高度时,这项工作使我在屏幕的按钮处留出空白
谢谢!我为我的英语不好对不起
这是我的代码:
products.addAll(Product.getExampleList());
var table =
Container(
child: SingleChildScrollView(
scrollDirection: Axis.horizontal,child:SizedBox(
child:
Column(
children: <Widget>[
DataTable(
columns: <DataColumn>[
DataColumn(
label: Text("Código")
),DataColumn(
label: Text("Precio"),numeric: true,),DataColumn(
label: Text("Grupo")
),DataColumn(
label: Text("Descripción")
),],rows:
products.map<DataRow>((Product element) {
return DataRow(
key: Key(element.idProduct.toString()),cells: <DataCell>[
DataCell(Text(element.code)),DataCell(Text("\$ " + element.price.toStringAsFixed(2))),DataCell(Text(element.group)),DataCell(Text(element.description))
],);
}).toList()
),)
),);
return Container(
color: Colors.white24,child:
Column(
children: <Widget>[
Container(
padding: EdgeInsets.all(10),child: Row(
children: <Widget>[
Text("Código: "),Flexible(
child: TextField(
controller: tController,decoration: InputDecoration(
hintText: "Ingrese Código"
),RaisedButton(
onpressed: onpressedSearch,child: Text("Buscar"),)
],Flex(
direction: Axis.vertical,children: <Widget>[
table
],)
);