如何在颤振中绘制不同高度的垂直线?

时间:2020-09-10 14:03:35

标签: flutter dart canvas

我有一个整数数组,对于该数组的每个元素,我想在屏幕上绘制一条具有该高度的垂直线,如何使用flutter实现呢?下面是我想要的结构,但高度不同。 enter image description here

1 个答案:

答案 0 :(得分:1)

我有个主意,尝试映射列表,然后使用此

Row(children:your_intger_list.map((val)=>_widget(height)).toList());


Widget _widget(int height){
   return Container(height:height,width:20,decoration:BoxDecoration(color:Colors.black));
}
相关问题