feature/itemlist #2

Merged
v4l3n71n merged 9 commits from feature/itemlist into main 2024-06-28 22:07:15 +00:00
Showing only changes of commit 4804c8bc01 - Show all commits

View File

@ -83,16 +83,22 @@ 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.separated( return Scaffold(
itemCount: posts.length, appBar: AppBar(
itemBuilder: (context, index) { // Here we take the value from the MyHomePage object that was created by
final post = posts[index]; // the App.build method, and use it to set our appbar title.
return ListTile( title: Text("Item list menu"),
title: Text('${post.name!}'), subtitle: Text('${post.place!}')); ),
}, body: ListView.separated(
separatorBuilder: (context, index) { itemCount: posts.length,
return Divider(); itemBuilder: (context, index) {
}, final post = posts[index];
); return ListTile(
title: Text('${post.name!}'), subtitle: Text('${post.place!}'));
},
separatorBuilder: (context, index) {
return Divider();
},
));
} }
} }