Himanshu Ranjan
Himanshu Ranjan

Reputation: 302

How to draw vertical lines of different heights in flutter?

I have an array of integers and for each element of that array , I Want to draw a vertical line on screen of that height.How can I implement this using flutter? Below is the structure that I want but with different heights. enter image description here

Upvotes: 1

Views: 804

Answers (1)

Anandha Krishnan Aji
Anandha Krishnan Aji

Reputation: 162

I got an idea, Try mapping the list,then Use this

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));
}

Upvotes: 1

Related Questions