Ejemplo 1: constructor de listview de flutter
List litems = ["1","2","Third","4"];
body: new ListView.builder
(
itemCount: litems.length,
itemBuilder: (BuildContext ctxt, int index) {
return new Text(litems[index]);
}
)
Ejemplo 2: base de fuego flutter de listviewbuilder
return new ListView.builder(
scrollDirection: Axis.vertical,
itemCount: snapshot.data.documents.length,
itemBuilder: (context, index) {
if (index == 0) {
return someWidget, // return the widget you want as "header" here
} else {
return _buildList( context, snapshot.data.documents[index-1]),
}
}
);
¡Haz clic para puntuar esta entrada!
(Votos: 0 Promedio: 0)