From 7d04953fa79ba12730cec41fce7edc7f95102b67 Mon Sep 17 00:00:00 2001 From: Valentin CZERYBA Date: Sat, 6 Jul 2024 09:43:35 +0200 Subject: [PATCH] add more info --- covas_mobile/lib/pages/ItemMenu.dart | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/covas_mobile/lib/pages/ItemMenu.dart b/covas_mobile/lib/pages/ItemMenu.dart index d981ea0..63f83b7 100644 --- a/covas_mobile/lib/pages/ItemMenu.dart +++ b/covas_mobile/lib/pages/ItemMenu.dart @@ -66,6 +66,7 @@ class _ItemMenuState extends State with ShowErrorDialog { String eventName = ""; String eventStartDate = ""; String organizers = ""; + String place = ""; Events? events; @override @@ -81,6 +82,7 @@ class _ItemMenuState extends State with ShowErrorDialog { String formerName = ""; String formerDate = ""; String formerOrga = ""; + String formerMap = ""; if (accessToken.isNotEmpty) { var urlGet = Uri.parse("${globals.api}/events/${widget.title}"); @@ -92,6 +94,7 @@ class _ItemMenuState extends State with ShowErrorDialog { stderr.writeln('Username : ${responseGet.body}'); var events = jsonDecode(utf8.decode(responseGet.bodyBytes)); formerName = events["name"]; + formerMap = events["place"]; final startDate = DateTime.parse(events["start_date"]); final date = DateFormat.yMd().format(startDate); final time = DateFormat.Hm().format(startDate); @@ -101,8 +104,9 @@ class _ItemMenuState extends State with ShowErrorDialog { final timeE = DateFormat.Hm().format(endDate); formerDate = "${date} ${time} à ${dateE} ${timeE}"; if (events["organizers"].length > 1) { - for (var orga in events["organizers"]) { - formerOrga = "${formerOrga}, ${orga}"; + formerOrga = "${events['organizers'][0]}"; + for (var i = 1; i < events["organizers"].length; i++) { + formerOrga = "${formerOrga}, ${events['organizers'][i]}"; } } else { formerOrga = "${events['organizers'][0]}"; @@ -161,6 +165,7 @@ class _ItemMenuState extends State with ShowErrorDialog { eventName = formerName; eventStartDate = formerDate; organizers = formerOrga; + place = formerMap; }); } @@ -199,6 +204,10 @@ class _ItemMenuState extends State with ShowErrorDialog { style: TextStyle(fontSize: 15.0)) ], ), + Row(children: [ + Icon(Icons.explore), + Text("Carte : ${place}", style: TextStyle(fontSize: 15.0)) + ]), Row(children: [ Icon(Icons.group), Text("Organisateurs : ${organizers}",