Home > Software design >  How to achieve this horizontal grid in Flutter?
How to achieve this horizontal grid in Flutter?

Time:11-10

Is there any way to achieve this UI in flutter, images are calling by an API, Card sizes are fixed. This should be scroll horizontally same as this.

enter image description here

CodePudding user response:

You can do like this:

ListView(
  // This next line does the trick.
  scrollDirection: Axis.horizontal,
  children: <Widget>[ /* your widgets */],
),

or as already pointed out in a comment, use the package flutter_staggered_grid_view

CodePudding user response:

the layout will always considered a top-to-bottom and left-to-right directions to simplify the description. However it is possible to change these directions in the code.

  • Related