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

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)),) ], ),
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 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. )
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.
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)),) ], ), )
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With