raman raman
raman raman

Reputation: 1811

How to populate custom widget items into listview in flutter?

enter image description here

I want to create listview like this image. How can I achieve this using flutter?

Please do a favour if you know how to make it?

Upvotes: 1

Views: 8492

Answers (1)

Vrushi Patel
Vrushi Patel

Reputation: 2431

You need a List view widget and with builder which contains a card widget which has Row as child.

ListView :-

ListView.builder(
        padding: EdgeInsets.all(10.0),
        shrinkWrap: false,
        itemCount: model.length,
        itemBuilder: (BuildContext context, int index) {
          return listItem(context, index);
        },

List item :-

model is removed

Widget listItem(BuildContext context, int index) {
  return Card(
  child: Row(
    children: <Widget>[

      Container(margin: EdgeInsets.all(10),child: Text("1")),
      Container(height: 20,width: 1,color: Colors.blue,),
      Container(margin:EdgeInsets.all(10),child: Text("asdasd"))
    ],
  ),
);
}

Upvotes: 2

Related Questions