flutter 怎么让datatable 也能自适应宽度

SizedBox.expand results in the DataTable taking an infinite height which the SingleChildScrollView won’t like. Since you only want to span the width of the parent, you can use a LayoutBuilder to get the size of the parent you care about and then wrap the DataTable in a ConstrainedBox.

来自网站: https://stackoverflow.com/questions/56625052/how-to-make-a-multi-column-flutter-datatable-widget-span-the-full-width