Skip to main content

prefer-using-list-view

added in: 1.6.0
Pro+

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 lint rule'),
Text('Wow another lint rule'),
],
),
),

✅ Good:

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

Additional Resources