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 '../main.dart';
mixin ShowErrorDialog<T extends StatefulWidget> on State<T> {
void showErrorDialog(BuildContext context, String text) {
// Create AlertDialog

View File

@ -3,11 +3,6 @@ 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});
@ -16,10 +11,5 @@ 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'];
}
}

View File

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