ListView (Flutter Widget of the Week)

Flutter · 405K views · 2019 · 1:29

Open on YouTube

Software (other)UX & UI designexplainer

Why Stack Overflow recommends it

Stack Overflow users link it as the official quick intro to ListView when answering Flutter layout questions, or cite it alongside the docs when explaining how ListView differs from GridView.

Recommended by 1 people across 1 different months, 2019 to 2022.

What it is

A 90-second entry in Flutter's 'Widget of the Week' series from the official Flutter channel. It introduces the ListView widget, showing how to turn a list of items into a scrollable list and how to customize it.

What people said

Recommends Maadhav Sharma · 2019-09 · Stack Overflow · on “Is it possible to have any widget like this in flutter”

The desired output can be brought using the ListView. Flutter just uploaded a video on ListView in which you can find your answer: [this video] Example code: import 'package:flutter/material.dart'; void main() => runApp(MyApp()); bool change ; class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( home: HomePage(), ); } } class HomePage extends StatefulWidget { @override _HomePageState createState() => _HomePageState(); } class _HomePageState extends State<HomePage> { int i=0; void fxn(){ setState(() { i++; }); } @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar(title: Text('List View'),), body: ListView.builder( itemC

Cites Ara Hussein · 2020-04 · Stack Overflow · on “How to display an async list in view using Rows and make it a button?”

you can use FutureBuilder widget it get a future till your method response and has builder to create a widget when the method response and get the snapshot if your method was not completed yet you build a waiter and if the data responded you build you ListView.builder is an easy way to create a list view if you have an existed list. var responseBody;//make this variable global to use it in our list view in builder method. getMicrocontrollers() async { String uri = 'Uri'; final prefs = await SharedPreferences.getInstance(); final key = 'Token'; final value = prefs.getString(key); var response = await http.get(uri, headers: {"Token": value}); responseBody = response.body; return responseBody }

Cites Anushka Chauhan · 2022-03 · Stack Overflow · on “When to use GridView and ListView in flutter since they do the same thing?”

ListView vs GridView ListView: The children are laid out one-dimensionally (direction can be horizontal or vertical). GridView: The children are laid out two-dimensionally . Even if you don't use the properties that make it visually 2D (by setting crossAxisCount: 1 ), it's still considered 2D. Different ListView Constructors ListView ListView( children: [allItems], ); ListView.builder It creates a list of items that are easily generated or otherwise need to be dynamically created. ListView.builder( itemBuilder: (context, index) => Text("Item $index"), itemCount: 10, // not required ); ListView.separated Similar to ListView.builder . It takes itemBuilder and separatorBuilder to create items a

Cites MendelG · 2022-03 · Stack Overflow · on “When to use GridView and ListView in flutter since they do the same thing?”

You can take a look at the official docs for the difference. Let's see how they're defined in the documentation: GirdView. [LINK] ( Video [LINK] ): A scrollable, 2D array of widgets. [LINK] ListView. [LINK] ( Video [this video] ): A scrollable list of widgets arranged linearly . [LINK]