add separator
This commit is contained in:
parent
10b8448917
commit
0c47c943f9
@ -83,13 +83,16 @@ class _MyHomePageState extends State<ListItemMenu> {
|
|||||||
// function to display fetched data on screen
|
// function to display fetched data on screen
|
||||||
Widget buildPosts(List<Events> posts) {
|
Widget buildPosts(List<Events> posts) {
|
||||||
// ListView Builder to show data in a list
|
// ListView Builder to show data in a list
|
||||||
return ListView.builder(
|
return ListView.separated(
|
||||||
itemCount: posts.length,
|
itemCount: posts.length,
|
||||||
itemBuilder: (context, index) {
|
itemBuilder: (context, index) {
|
||||||
final post = posts[index];
|
final post = posts[index];
|
||||||
return ListTile(
|
return ListTile(
|
||||||
title: Text('${post.name!}'), subtitle: Text('${post.place!}'));
|
title: Text('${post.name!}'), subtitle: Text('${post.place!}'));
|
||||||
},
|
},
|
||||||
|
separatorBuilder: (context, index) {
|
||||||
|
return Divider();
|
||||||
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user