如何像这样在颤振中做数据

时间:2021-01-28 06:29:23

标签: flutter flutter-layout flutter-web

我需要在如下图所示的数据表中隐藏和显示 enter image description here

1 个答案:

答案 0 :(得分:2)

<块引用>
 Use this Code For the Hide and Show System
 Visibility(
  
      visible: false,
child : DataTable(
  columns: const <DataColumn>[
    DataColumn(
      label: Text(
        'Name',
      ),
    ),
    DataColumn(
      label: Text(
        'Age',
      ),
    ),
    ......
  ],
  rows: const <DataRow>[
    DataRow(
      cells: <DataCell>[
        DataCell(Text('Mohit')),
        DataCell(Text('23')),
        DataCell(Text('Professional')),
      ],
    ),
    DataRow(
      cells: <DataCell>[
        DataCell(Text('Aditya')),
        DataCell(Text('24')),
        DataCell(Text('Associate Professor')),
      ],
    ),
     ....
  ],
),
    ),

然后 ---> onPressed(){ 可见性(

      visible: true,

}