简体   繁体   English

Flutter 使 TableRow 占用剩余的可用空间

[英]Flutter make TableRow take the rest available space

I have a table with 3 rows, the IntrinsicColumnWidth method set the sizes of the column according to the intrinsic dimensions of all the cells in that column.我有一个 3 行的表格, IntrinsicColumnWidth方法根据该列中所有单元格的固有尺寸设置列的大小。 that means that they will take the minimum possible width.这意味着它们将采用尽可能小的宽度。 that exactly what i want for the first and the second column.这正是我想要的第一列和第二列。 My question is how can i make the third row takes the rest available space我的问题是如何让第三行占用其余可用空间

Table(
   columnWidths: {
     0: IntrinsicColumnWidth(),
     1: IntrinsicColumnWidth(),
     2: IntrinsicColumnWidth(), // i want this one to take the rest available space
   },
   ...
),

I know it's late, but to anyone else looking for an answer to this question, you can try the code below.我知道现在已经晚了,但是对于正在寻找此问题答案的其他人,您可以尝试以下代码。

Table(
   columnWidths: {
     0: FlexColumnWidth(1.0),
     1: FlexColumnWidth(1.0),
     2: IntrinsicColumnWidth(), // i want this one to take the rest available space
   },
   ...
),

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在 Flutter 中使用容器获取可用空间 - How to take available space using container in Flutter 我们如何使图像在 flutter 的浮动操作按钮中占据整个可用空间 - How do we can make a image to take the whole space available in the floating action button in flutter 使小部件扩展到可用空间颤动 - Make a widget expand to available space flutter 允许flutter Column在这种布局中占据所有可用空间 - Allow flutter Column to take all the available Space in this kind of layout 在 Flutter 中,如何使多行文本的可滚动视图作为列的一部分占据所有可用的水平空间? - In Flutter, how can I make a scrollable view of multiline text take up all the available horizontal space, as part of a column? 如何调整 flutter 表的大小以占用整个可用空间? - How to resize a flutter table to take the whole available space? Flutter Expanded TextWidget 不占用 rest 的剩余空间 - Flutter Expanded TextWidget does not take rest of the space left 如何让桌子沿高度占用可用空间? - How can I make the table take the available space along the height? 如何使TextField占用所有可用的垂直空间? - How to make TextField to take all available vertical space? 如何在 Flutter 中实现 TableRow 的可重用继承 - How to make reusable inheritance of TableRow in Flutter
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM