What is ListView and its types?

 ListView is used for displaying a scrollable list of items.

Types:

  1. ListView() – Default constructor

  2. ListView.builder() – Efficient for long lists

  3. ListView.separated() – With separators

  4. ListView.custom() – Custom behavior

Example:

ListView.builder( itemCount: items.length, itemBuilder: (context, index) { return ListTile(title: Text(items[index])); }, );

Comments

Popular posts from this blog

1. What is Flutter?

What is FutureBuilder and StreamBuilder?