From 4804c8bc01b5e71a0c3d08accd50c8ad973f51a3 Mon Sep 17 00:00:00 2001 From: Valentin CZERYBA Date: Wed, 26 Jun 2024 22:32:27 +0200 Subject: [PATCH] title app --- covas_mobile/lib/ListItemMenu.dart | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/covas_mobile/lib/ListItemMenu.dart b/covas_mobile/lib/ListItemMenu.dart index 0ab0041..2ceded1 100644 --- a/covas_mobile/lib/ListItemMenu.dart +++ b/covas_mobile/lib/ListItemMenu.dart @@ -83,16 +83,22 @@ class _MyHomePageState extends State { // function to display fetched data on screen Widget buildPosts(List posts) { // ListView Builder to show data in a list - return ListView.separated( - itemCount: posts.length, - itemBuilder: (context, index) { - final post = posts[index]; - return ListTile( - title: Text('${post.name!}'), subtitle: Text('${post.place!}')); - }, - separatorBuilder: (context, index) { - return Divider(); - }, - ); + return Scaffold( + appBar: AppBar( + // Here we take the value from the MyHomePage object that was created by + // the App.build method, and use it to set our appbar title. + title: Text("Item list menu"), + ), + body: ListView.separated( + itemCount: posts.length, + itemBuilder: (context, index) { + final post = posts[index]; + return ListTile( + title: Text('${post.name!}'), subtitle: Text('${post.place!}')); + }, + separatorBuilder: (context, index) { + return Divider(); + }, + )); } }