Below is the code what I did, but it perform nothing.
class _MenuListState extends State<MenuList> {
List<ListTile> menu = [
ListTile(
leading: Icon(Icons.featured_play_list),
title: Text('Playlists'),
),
ListTile(
leading: Icon(Icons.send),
title: Text('Menu...'),
),
ListTile(
leading: Icon(Icons.logout),
title: Text('Logout'),
),
];
@override
Widget build(BuildContext context) {
return Scaffold(
body: ListView.builder(
itemCount: menu.length,
itemBuilder: (BuildContext context, int index) {
final menuList = menu[index];
},
),
);
}
}
As mentioned as title, how can I let the code perform that the screen prompt out all the ListTile inside the List?
2
Answers
Return the widget in itemBuilder
You Just need to Return menuListItem