Flutter - Displaying two ListViews on one screen

前端 未结 3 1419
天涯浪人
天涯浪人 2021-02-02 16:37

I\'m trying to add a horizontal listView.builder on top of another vertical listView.builder. Both listViews should have text

3条回答
  •  梦谈多话
    2021-02-02 17:15

    This might not be the cleanest way to do this, but I’m relatively new to flutter so it’s the best I can do.

    First I created a master container to pass all the info through so I can keep all relative code in their respected places, this piece allows me to show both listViews in the same container

    This is one of the containers that’s passed to _positonalArguments. This lets me keep the elements from overflowing, for instance the maxHeight: 335.0, is a strict parameter found due to trial and error.

    I used the same BoxConstraints in both containers passed to _positionalArguments, along with the same margin values.

    Sorry I’m using images instead of pasting code, I’m using stack on my phone to answer this.

提交回复
热议问题