Compare commits

..

No commits in common. "112eab3125549b889f3bd3aebdf319965b4a8818" and "5e0d3ab72eec20105bc25ac3e0ffab4a46108efc" have entirely different histories.

3 changed files with 10 additions and 59 deletions

View File

@ -1,5 +1,7 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import '../main.dart';
mixin ShowErrorDialog<T extends StatefulWidget> on State<T> { mixin ShowErrorDialog<T extends StatefulWidget> on State<T> {
void showErrorDialog(BuildContext context, String text) { void showErrorDialog(BuildContext context, String text) {
// Create AlertDialog // Create AlertDialog

View File

@ -3,11 +3,6 @@ class Events {
String? name; String? name;
String? place; String? place;
String? startDate; String? startDate;
String? endDate;
String? description;
String? zipCode;
String? city;
String? country;
Events({this.place, this.id, this.name, this.startDate}); Events({this.place, this.id, this.name, this.startDate});
@ -16,10 +11,5 @@ class Events {
name = json['name']; name = json['name'];
place = json['place']; place = json['place'];
startDate = json["start_date"]; startDate = json["start_date"];
endDate = json['end_date'];
description = json['description'];
zipCode = json["zip_code"];
city = json['city'];
country = json['country'];
} }
} }

View File

@ -67,7 +67,6 @@ class _ItemMenuState extends State<ItemMenu> with ShowErrorDialog {
String listUser = ""; String listUser = "";
String eventName = ""; String eventName = "";
String eventStartDate = ""; String eventStartDate = "";
String eventDescription = "";
String organizers = ""; String organizers = "";
String place = ""; String place = "";
String imgUrl = ""; String imgUrl = "";
@ -88,7 +87,6 @@ class _ItemMenuState extends State<ItemMenu> with ShowErrorDialog {
String formerOrga = ""; String formerOrga = "";
String formerMap = ""; String formerMap = "";
String formerImage = ""; String formerImage = "";
String formerDesc = "";
if (accessToken.isNotEmpty) { if (accessToken.isNotEmpty) {
var urlGet = Uri.parse("${globals.api}/events/${widget.title}"); var urlGet = Uri.parse("${globals.api}/events/${widget.title}");
@ -100,9 +98,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 = formerMap = events["place"];
"${events["place"]} - ${events["zip_code"]} ${events["city"]} - ${events["country"]}";
formerDesc = events["description"];
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);
@ -180,7 +176,6 @@ class _ItemMenuState extends State<ItemMenu> with ShowErrorDialog {
organizers = formerOrga; organizers = formerOrga;
place = formerMap; place = formerMap;
imgUrl = formerImage; imgUrl = formerImage;
eventDescription = formerDesc;
}); });
} }
@ -217,61 +212,25 @@ class _ItemMenuState extends State<ItemMenu> with ShowErrorDialog {
child: Container(height: 250, child: Image.network(imgUrl)), child: Container(height: 250, child: Image.network(imgUrl)),
), ),
), ),
Row(children: [
Icon(Icons.event),
Text(
"Date : ",
style: TextStyle(fontSize: 15.0, fontWeight: FontWeight.bold),
)
]),
Row( Row(
children: [ children: [
Flexible( Icon(Icons.event),
child: Text("${eventStartDate}", Text("Date : ${eventStartDate}",
style: TextStyle(fontSize: 15.0))) style: TextStyle(fontSize: 15.0))
], ],
), ),
Row(children: [ Row(children: [
Icon(Icons.explore), Icon(Icons.explore),
Text( Text("Carte : ${place}", style: TextStyle(fontSize: 15.0))
"Carte : ",
style: TextStyle(fontSize: 15.0, fontWeight: FontWeight.bold),
)
]),
Row(children: [
Flexible(
child: Text("${place}",
style: TextStyle(fontSize: 15.0),
maxLines: 3,
overflow: TextOverflow.ellipsis))
]), ]),
Row(children: [ Row(children: [
Icon(Icons.group), Icon(Icons.group),
Text( Text("Organisateurs : ${organizers}",
"Organisateurs : ", style: TextStyle(fontSize: 15.0))
style: TextStyle(fontSize: 15.0, fontWeight: FontWeight.bold),
)
]),
Row(children: [
Flexible(
child: Text(
"${organizers}",
style: TextStyle(fontSize: 15.0),
maxLines: 3,
overflow: TextOverflow.ellipsis,
))
]), ]),
Row(children: [ Row(children: [
Icon(Icons.description), Icon(Icons.description),
Text("Description : ", Text("Description : ", style: TextStyle(fontSize: 15.0))
style: TextStyle(fontSize: 15.0, fontWeight: FontWeight.bold))
]),
Row(children: [
Flexible(
child: Text("${eventDescription}",
style: TextStyle(fontSize: 15.0),
maxLines: 3,
overflow: TextOverflow.ellipsis))
]) ])
], ],
))); )));