How the listview content horizontally without looking over flutter?

Viewed 25

I need to show the listview content horizontally without looking over it. I maintain that the substance should be on a new line when the width is full. how might I do that?

2 Answers

I think you're looking for Wrap, use it with a SingleChildScrollView like so:

SingleChildScrollView(
  child: Wrap(
    children: [
      // your children.
    ]
  )
)

You can use aspect ratio to make a horizontally listview. An example starting code;

  Widget buildCard({
    required CardItem item,
  }) =>
      Container(
        width: 200,
        child: Column(
          children: [
            Expanded(
              child: AspectRatio(
                aspectRatio: 4 / 3,
                ...
                
          

Related