DEV Community

MANOJ AP
MANOJ AP

Posted on • Edited on

Flutter listview crashes in Column widget

Flutter

Listview and Column Widget

Sometimes you may want to combine UI vertically along the screen, that’s were we need a Column Widget.

When I tried to place a search box, a customized Text widget, and ListView widget, Flutter shower with errors.

Column(
children: [
SearchBox(hintText: 'Search', controller: textController),
ListView.builder(
// the number of items in the list
itemCount: adList.length,

This happens because in the column widget Listview didn’t fit. To make it adjustable for the column wrap the ListView with Expanded widget, in case of Vertical listview.

The expanded widget can have single child widget.

Column(
children: [
SearchBox(hintText: 'Search', controller: textController),
Expanded(
child: ListView.builder(

and it should solve the issue.

Following Flutter posts deserve a good read

Flutter Desktop Support - OpenSuse
Flutter support for Windows

Sentry mobile image

Improving mobile performance, from slow screens to app start time

Based on our experience working with thousands of mobile developer teams, we developed a mobile monitoring maturity curve.

Read more

Top comments (0)

AWS Security LIVE!

Join us for AWS Security LIVE!

Discover the future of cloud security. Tune in live for trends, tips, and solutions from AWS and AWS Partners.

Learn More

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay