2

My Column won't scroll when using this piece of code:

Flexible(
   child: new ListView(
   scrollDirection: Axis.vertical,
   shrinkWrap: true,
   physics: AlwaysScrollableScrollPhysics(),
   children: <Widget>[
       CarsList(uid: widget.uid),
       MotorbikeList(uid: widget.uid)
     ],
   )
),

I can open both Expansion Tiles just fine and also other expansion tiles within them, but I can't scroll down to see the ones hiding in the bottom.

When I wrap them individually into Flex Widget I can then scroll through them but they are not using the entire space of the column when expanded.

Flexible(
   child: CarsList(uid: widget.uid),
),

Flexible(
   child: MotorbikeList(uid: widget.uid),
)

[Now I can scroll down, but they don't expand as I want them too[3]

1 Answer 1

4

Try this code:

  Flexible(
    child: new ListView(
      scrollDirection: Axis.vertical,
      shrinkWrap: true,
      physics: AlwaysScrollableScrollPhysics(),
      children: <Widget>[
        Expanded(
          child: CustomScrollView(slivers: <Widget>[
            SliverList(
              delegate: SliverChildBuilderDelegate(
                (BuildContext context, int index) {
                  CarsList(uid: widget.uid),
                  MotorbikeList(uid: widget.uid)
                  },
                childCount: 2,
              ),
            ),
          ])),
      ],
    ));

Sign up to request clarification or add additional context in comments.

3 Comments

There is a height constraint problem with this one. I'm trying some workarounds, but so far no success :/ Thanks a lot for the suggestion tho. Really appreciated :)
Really thanks you solved my issue. I can't believe it was that easy <3
Thumbs Up dear, Thank you so much, Flexible with ListView worked like charm :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.