0

I was tryiing to use double row in a single Listview which should scroll together in a single ListView Widget when i added double rows in a column inside the listview wigdget I combine both rows instead of creating a new row. Image is attached.Marked Section

Farhan Aslam
  • 51
  • 1
  • 2

1 Answers1

0

You can use GridView instead, Here is the sample code

Container(
      height: 150,
      width: MediaQuery.of(context).size.width,
      child: GridView.builder(
        itemCount: 20,
        gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
          crossAxisCount: 2,
          crossAxisSpacing: 1,
          mainAxisSpacing: 1,
          childAspectRatio: 1,
        ),
        scrollDirection: Axis.horizontal,
        itemBuilder: (context, index) {
          return Container(
            color: Colors.red,
            child: Column(
              mainAxisAlignment: MainAxisAlignment.center,
              children: [
                Icon(Icons.ac_unit),
                Text('data $index'),
              ],
            ),
          );
        },
      ),
    );
Hemal Moradiya
  • 1,715
  • 1
  • 6
  • 26