add info for event

This commit is contained in:
2024-09-25 23:08:28 +02:00
parent 5e0d3ab72e
commit 1cdae0bb33
3 changed files with 18 additions and 4 deletions

View File

@@ -67,6 +67,7 @@ class _ItemMenuState extends State<ItemMenu> with ShowErrorDialog {
String listUser = "";
String eventName = "";
String eventStartDate = "";
String eventDescription = "";
String organizers = "";
String place = "";
String imgUrl = "";
@@ -87,6 +88,7 @@ class _ItemMenuState extends State<ItemMenu> with ShowErrorDialog {
String formerOrga = "";
String formerMap = "";
String formerImage = "";
String formerDesc = "";
if (accessToken.isNotEmpty) {
var urlGet = Uri.parse("${globals.api}/events/${widget.title}");
@@ -98,7 +100,9 @@ class _ItemMenuState extends State<ItemMenu> with ShowErrorDialog {
stderr.writeln('Username : ${responseGet.body}');
var events = jsonDecode(utf8.decode(responseGet.bodyBytes));
formerName = events["name"];
formerMap = events["place"];
formerMap =
"${events["place"]} - ${events["zip_code"]} ${events["city"]} - ${events["country"]}";
formerDesc = events["description"];
final startDate = DateTime.parse(events["start_date"]);
final date = DateFormat.yMd().format(startDate);
final time = DateFormat.Hm().format(startDate);
@@ -176,6 +180,7 @@ class _ItemMenuState extends State<ItemMenu> with ShowErrorDialog {
organizers = formerOrga;
place = formerMap;
imgUrl = formerImage;
eventDescription = formerDesc;
});
}
@@ -230,7 +235,8 @@ class _ItemMenuState extends State<ItemMenu> with ShowErrorDialog {
]),
Row(children: [
Icon(Icons.description),
Text("Description : ", style: TextStyle(fontSize: 15.0))
Text("Description : ${eventDescription}",
style: TextStyle(fontSize: 15.0))
])
],
)));