Skip to main content

prefer-using-list-view

Warns when a Column widget with only children parameter is wrapped in a SingleChildScrollView widget.

Example

❌ Bad:

// LINT: Prefer 'ListView' instead of 'SingleChildScrollView' with a 'Column' widget inside.
SingleChildScrollView(
child: Column(
children: [
Text('Wow, a lint rule'),
Text('Wow, another lint rule'),
],
),
),

✅ Good:

ListView(
children: [
Text('Wow, a lint rule'),
Text('Wow, another lint rule'),
],
),

Additional Resources