Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vertical Divider not showing

I'm trying to use the VerticalDivider widget to separate items in the Row. Here is the whole body.

enter image description here

Row:

Row(   children: <Widget>[     Text('420 Posts', style: TextStyle(color: Color(0xff666666)),),     VerticalDivider(       thickness: 2,       width: 20,       color: Colors.black,     ),     Text('420 Posts', style: TextStyle(color: Color(0xff666666)),)   ], ), 
like image 601
Burak Avatar asked Jan 29 '20 03:01

Burak


People also ask

How do you show the divider in flutter?

If you needed the row widget there, another way to provide the column width for the Divider class would be to wrap the Column Widget with something like Expanded - then your code would work.

How do you add a divider line in flutter?

How to Add Vertical Divider: VerticalDivider( color: Colors. black, //color of divider width: 10, //width space of divider thickness: 3, //thickness of divier line indent: 10, //Spacing at the top of divider. endIndent: 10, //Spacing at the bottom of divider. )

What is a vertical divider?

A thin vertical line, with padding on either side. In the material design language, this represents a divider. Vertical dividers can be used in horizontally scrolling lists, such as a ListView with ListView.


Video Answer


1 Answers

Wrap your Row with IntrinsicHeight,

IntrinsicHeight(   child: Row(     children: <Widget>[       Text('420 Posts', style: TextStyle(color: Color(0xff666666)),),       VerticalDivider(         thickness: 2,         width: 20,         color: Colors.black,       ),       Text('420 Posts', style: TextStyle(color: Color(0xff666666)),)     ],   ), ) 
like image 68
Crazy Lazy Cat Avatar answered Sep 22 '22 12:09

Crazy Lazy Cat