diff --git a/covas_mobile/lib/classes/alert.dart b/covas_mobile/lib/classes/alert.dart index ea691aa..7ca853a 100644 --- a/covas_mobile/lib/classes/alert.dart +++ b/covas_mobile/lib/classes/alert.dart @@ -1,7 +1,5 @@ import 'package:flutter/material.dart'; -import '../main.dart'; - mixin ShowErrorDialog on State { void showErrorDialog(BuildContext context, String text) { // Create AlertDialog diff --git a/covas_mobile/lib/classes/events.dart b/covas_mobile/lib/classes/events.dart index c1cb070..d908a58 100644 --- a/covas_mobile/lib/classes/events.dart +++ b/covas_mobile/lib/classes/events.dart @@ -3,6 +3,11 @@ class Events { String? name; String? place; String? startDate; + String? endDate; + String? description; + String? zipCode; + String? city; + String? country; Events({this.place, this.id, this.name, this.startDate}); @@ -11,5 +16,10 @@ class Events { name = json['name']; place = json['place']; startDate = json["start_date"]; + endDate = json['end_date']; + description = json['description']; + zipCode = json["zip_code"]; + city = json['city']; + country = json['country']; } } diff --git a/covas_mobile/lib/pages/ItemMenu.dart b/covas_mobile/lib/pages/ItemMenu.dart index 77710e2..1d6e920 100644 --- a/covas_mobile/lib/pages/ItemMenu.dart +++ b/covas_mobile/lib/pages/ItemMenu.dart @@ -67,6 +67,7 @@ class _ItemMenuState extends State with ShowErrorDialog { String listUser = ""; String eventName = ""; String eventStartDate = ""; + String eventDescription = ""; String organizers = ""; String place = ""; String imgUrl = ""; @@ -87,6 +88,7 @@ class _ItemMenuState extends State 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 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 with ShowErrorDialog { organizers = formerOrga; place = formerMap; imgUrl = formerImage; + eventDescription = formerDesc; }); } @@ -230,7 +235,8 @@ class _ItemMenuState extends State with ShowErrorDialog { ]), Row(children: [ Icon(Icons.description), - Text("Description : ", style: TextStyle(fontSize: 15.0)) + Text("Description : ${eventDescription}", + style: TextStyle(fontSize: 15.0)) ]) ], )));