小编Seb*_*rdi的帖子

在 Flutter 中展开 DataTable 以填充高度

我遇到了抖动问题。\n我需要在屏幕高度填充数据表。

\n

我尝试在 Flex 小部件中添加 dataTable,但没有得到任何更改。

\n

当我设置容器的高度时,让我在屏幕按钮处留出一个空白区域

\n

谢谢你!我很抱歉我的英语很差

\n

这是我的代码:

\n
products.addAll(Product.getExampleList());\n\nvar table =\n\nContainer(\n  child: SingleChildScrollView(\n        scrollDirection: Axis.horizontal,\n        child:SizedBox(\n            child:\n            Column(\n              children: <Widget>[\n                DataTable(\n                    columns: <DataColumn>[\n                      DataColumn(\n                          label: Text("C\xc3\xb3digo")\n                      ),\n                      DataColumn(\n                        label: Text("Precio"),\n                        numeric: true,\n                      ),\n                      DataColumn(\n                          label: Text("Grupo")\n                      ),\n                      DataColumn(\n                          label: Text("Descripci\xc3\xb3n")\n                      ),\n                    ],\n                    rows:\n                    products.map<DataRow>((Product element) {\n                      return DataRow(\n                        key: Key(element.idProduct.toString()),\n                        cells: <DataCell>[\n                          DataCell(Text(element.code)),\n                          DataCell(Text("\\$ " + element.price.toStringAsFixed(2))),\n                          DataCell(Text(element.group)),\n                          DataCell(Text(element.description))\n                        ],\n                      );\n                    }).toList()\n                ),\n              ],\n            )\n        ),\n      ),\n);\n\n\nreturn  Container(\n    color: Colors.white24,\n    child:\n      Column(\n      children: <Widget>[\n        Container(\n …
Run Code Online (Sandbox Code Playgroud)

datatable fill dart flutter

11
推荐指数
1
解决办法
2万
查看次数

标签 统计

dart ×1

datatable ×1

fill ×1

flutter ×1