Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR DART

flutter ListTile

// using card
Card(
          elevation: 5,
          child: ListTile(
            leading: Icon(Icons.icecream),
            title: Text('I like icecream'),
            subtitle: Text('Icream is good for health'),
            trailing: Icon(Icons.food_bank),
          ),
        ),
        
// using ListView.builder
ListView.builder(
      itemCount: dummyList.length,
      itemBuilder: (context, index) => Card(
        elevation: 6,
        margin: EdgeInsets.all(10),
        child: ListTile(
          leading: CircleAvatar(
            child: Text(dummyList[index]["id"].toString()),
            backgroundColor: Colors.purple,
          ),
          title: Text(dummyList[index]["title"]),
          subtitle: Text(dummyList[index]["subtitle"]),
          trailing: Icon(Icons.add_a_photo),
        ),
      ),
    )
Source by www.kindacode.com #
 
PREVIOUS NEXT
Tagged: #flutter #ListTile
ADD COMMENT
Topic
Name
6+1 =