Answers for "how to get item count from a listview in flutter"

9

flutter listview builder

List<String> litems = ["1","2","Third","4"];
body: new ListView.builder
  (
    itemCount: litems.length,
    itemBuilder: (BuildContext ctxt, int index) {
     return new Text(litems[index]);
    }
  )
Posted by: Guest on June-18-2020
0

flutter count list

var comments = <Comment>[...];
var count = comments.where((c) => c.product_id == someProductId).toList().length;
Posted by: Guest on July-12-2020

Code answers related to "how to get item count from a listview in flutter"

Browse Popular Code Answers by Language