skip to Main Content

I have a VerticalDivider inside a Row inside Column inside a SingleChildScrollView inside a LayoutBuilder:

LayoutBuilder(
                builder: (context, constraints) => 
                [...]
                 SingleChildScrollView(
                            child: Column(
                              mainAxisSize: MainAxisSize.min,
                              children: [
                                Row(
                                  crossAxisAlignment: CrossAxisAlignment.start,
                                  children: [
                                   [...]
                                    VerticalDivider(
                                            width: 1,
                                            thickness: 1,
                                          ),
                                   [...]

The way it is, the VerticalDivider is not showing up. I guess it doesn’t know its height.

If I put a SizedBox around the VerticalDivider, with height from LayoutBuilder or MediaQuery, it will set the height once and when I scroll down, the vertical divider won’t reach all the way to the bottom.

How can I make a vertical divider resize with its parent. I get an error message with double.infinity since SingleChildScrollViewdoesn’t give vertical bounds.

Did I explain this properly?

enter image description here

2

Answers


  1. Chosen as BEST ANSWER

    I used the InstrinsicHeight Widget, wich is cost-intensiv and leads to problem which widget, that can't calculate an intrinsic height, but it works for now.


  2. increase the width and it will became visible you have given 1 width which is too small to notice.

    try this:

     VerticalDivider(
        width: 20,
        thickness: 1,
       ),
    

    checkout the difference between output for width 1 and width 20

    width:1;

    enter image description here

    width:20;

    enter image description here

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search