Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

ListView.builder is not scrolling inside column

I have ListView.builder inside scrollable Column. But The content inside ListView.builder is not scrolling.

final List<String> entries = <String>[
  'Item 1',
  'Item 2',
  'Item 3',
  'Item 4',
  'Item 5',
  'Item 6',
  'Item 7',
  'Item 8',
  'Item 9',
  'Item 10',
  'Item 11',
  'Item 12',
  'Item 13',
  'Item 14',
  'Item 15',
  'Item 16',
  'Item 17',
  'Item 18',
  'Item 19',
  'Item 20',
];
Widget build(BuildContext context) {
  return SingleChildScrollView(
    child: Column(
      children: [
        Text(
          'Heading',
          style: TextStyle(fontSize: 24),
        ),
        ListView.builder(
          shrinkWrap: true,
          padding: const EdgeInsets.all(8),
          itemCount: entries.length,
          itemBuilder: (BuildContext context, int index) {
            return Container(
              height: 150,
              width: 150,
              decoration: BoxDecoration(
                border: Border.all(width: 2.0, color: Colors.red),
                borderRadius: BorderRadius.all(Radius.circular(10)),
              ),
              child: Center(child: Text('${entries[index]}')),
            );
          },
        ),
        Text(
          'Footer',
          style: TextStyle(fontSize: 24),
        ),
      ],
    ),
  );
}

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Add this to your ListView.builder()

physics: const ScrollPhysics(),
padding: EdgeInsets.zero,
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading