add more info
This commit is contained in:
parent
34c2b5d322
commit
7d04953fa7
@ -66,6 +66,7 @@ class _ItemMenuState extends State<ItemMenu> with ShowErrorDialog {
|
|||||||
String eventName = "";
|
String eventName = "";
|
||||||
String eventStartDate = "";
|
String eventStartDate = "";
|
||||||
String organizers = "";
|
String organizers = "";
|
||||||
|
String place = "";
|
||||||
|
|
||||||
Events? events;
|
Events? events;
|
||||||
@override
|
@override
|
||||||
@ -81,6 +82,7 @@ class _ItemMenuState extends State<ItemMenu> with ShowErrorDialog {
|
|||||||
String formerName = "";
|
String formerName = "";
|
||||||
String formerDate = "";
|
String formerDate = "";
|
||||||
String formerOrga = "";
|
String formerOrga = "";
|
||||||
|
String formerMap = "";
|
||||||
|
|
||||||
if (accessToken.isNotEmpty) {
|
if (accessToken.isNotEmpty) {
|
||||||
var urlGet = Uri.parse("${globals.api}/events/${widget.title}");
|
var urlGet = Uri.parse("${globals.api}/events/${widget.title}");
|
||||||
@ -92,6 +94,7 @@ class _ItemMenuState extends State<ItemMenu> with ShowErrorDialog {
|
|||||||
stderr.writeln('Username : ${responseGet.body}');
|
stderr.writeln('Username : ${responseGet.body}');
|
||||||
var events = jsonDecode(utf8.decode(responseGet.bodyBytes));
|
var events = jsonDecode(utf8.decode(responseGet.bodyBytes));
|
||||||
formerName = events["name"];
|
formerName = events["name"];
|
||||||
|
formerMap = events["place"];
|
||||||
final startDate = DateTime.parse(events["start_date"]);
|
final startDate = DateTime.parse(events["start_date"]);
|
||||||
final date = DateFormat.yMd().format(startDate);
|
final date = DateFormat.yMd().format(startDate);
|
||||||
final time = DateFormat.Hm().format(startDate);
|
final time = DateFormat.Hm().format(startDate);
|
||||||
@ -101,8 +104,9 @@ class _ItemMenuState extends State<ItemMenu> with ShowErrorDialog {
|
|||||||
final timeE = DateFormat.Hm().format(endDate);
|
final timeE = DateFormat.Hm().format(endDate);
|
||||||
formerDate = "${date} ${time} à ${dateE} ${timeE}";
|
formerDate = "${date} ${time} à ${dateE} ${timeE}";
|
||||||
if (events["organizers"].length > 1) {
|
if (events["organizers"].length > 1) {
|
||||||
for (var orga in events["organizers"]) {
|
formerOrga = "${events['organizers'][0]}";
|
||||||
formerOrga = "${formerOrga}, ${orga}";
|
for (var i = 1; i < events["organizers"].length; i++) {
|
||||||
|
formerOrga = "${formerOrga}, ${events['organizers'][i]}";
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
formerOrga = "${events['organizers'][0]}";
|
formerOrga = "${events['organizers'][0]}";
|
||||||
@ -161,6 +165,7 @@ class _ItemMenuState extends State<ItemMenu> with ShowErrorDialog {
|
|||||||
eventName = formerName;
|
eventName = formerName;
|
||||||
eventStartDate = formerDate;
|
eventStartDate = formerDate;
|
||||||
organizers = formerOrga;
|
organizers = formerOrga;
|
||||||
|
place = formerMap;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -199,6 +204,10 @@ class _ItemMenuState extends State<ItemMenu> with ShowErrorDialog {
|
|||||||
style: TextStyle(fontSize: 15.0))
|
style: TextStyle(fontSize: 15.0))
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
Row(children: [
|
||||||
|
Icon(Icons.explore),
|
||||||
|
Text("Carte : ${place}", style: TextStyle(fontSize: 15.0))
|
||||||
|
]),
|
||||||
Row(children: [
|
Row(children: [
|
||||||
Icon(Icons.group),
|
Icon(Icons.group),
|
||||||
Text("Organisateurs : ${organizers}",
|
Text("Organisateurs : ${organizers}",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user