0

I am trying to get the layout as in the gif below but could not get any resource to continue with. There are two rows with multiple columns and is scrollable. How can I achieve such layout?

enter image description here

Nabin Dhakal
  • 1,949
  • 3
  • 20
  • 48

2 Answers2

1

As your question says, you follow this approach, and it is not containing multiple columns, items are having different width. This snippet will work fine.

SingleChildScrollView(
              scrollDirection: Axis.horizontal,
              child: Column(
                children: [
                  Row(
                    key: const ValueKey("row1"),
                    children: _items(),
                  ),
                  Row(
                    key: const ValueKey("row2"),
                    children: _items(),
                  ),
                ],
              ),
            ),
Md. Yeasin Sheikh
  • 54,221
  • 7
  • 29
  • 56
0

You can achieve this by SingleChildScrolView widget with axis : horizontal and that listitem will be created using FilterChip widget.

like this :

 SingleChildScrollView(
                                scrollDirection: Axis.horizontal,
                                child:  Wrap(
                                  spacing: 10.0,
                                  runSpacing: 5.0,
                                  children: [...generateTags()],
                                ),
                              ),






 generateTags(){
    return _keywords.map((e) => FilterChip(label : e)).toList();
  }



var _keywords =["hello" , "hi" ,"words 1" , "word 2"];
Hardik Mehta
  • 2,195
  • 1
  • 11
  • 14
  • I could achieve what you have suggested but my question is different. I want to show the list items values in 2 rows with multiple columns as in gif mentioned – Nabin Dhakal Dec 06 '21 at 10:51