'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)),)
  ],
),


Solution 1:[1]

You can also wrap Row into Container with specified height.

Solution 2:[2]

The VerticalDivider need height for work correctly, use it with the SizedBox or equivalent with height param defined.

Example:

SizedBox(
   height: 40
   child: VerticalDivider(
      thickness: 2,
      width: 20,
      color: Colors.black,
   ),
)

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Александр Бабич
Solution 2 Emanoel Vieira