Jitesh Mohite
Jitesh Mohite

Reputation: 34210

Flutter: Divider not showing in Row Widget

The question says itself what is the problem

Code Snippet: Below code working fine for Column, but when I replaced it with Row, it's not showing Divider on the screen.

 Column(
        children: <Widget>[
          Divider(
            thickness: 1,
            color: Colors.black,
          ),
          SizedBox(
            width: 50,
          ),
          Divider(
            thickness: 1,
            color: Colors.black,
          ),
        ],
      ),

Upvotes: 2

Views: 2208

Answers (1)

Jitesh Mohite
Jitesh Mohite

Reputation: 34210

Row Widget required to be used Divider with Expanded/Flexible Widget

    Row(
        children: <Widget>[
          Flexible(
            child: Divider(
              thickness: 1,
              color: Colors.black,
            ),
          ),
          SizedBox(
            width: 10,
          ),
          Flexible(
            child: Divider(
              thickness: 1,
              color: Colors.black,
            ),
          ),
        ],
      ),

Upvotes: 6

Related Questions