fix edit event
This commit is contained in:
@@ -128,17 +128,17 @@ class _ItemMenuState extends State<ItemMenu> with ShowAlertDialog {
|
||||
if (responseGet.statusCode == 200) {
|
||||
final responseBody = utf8.decode(responseGet.bodyBytes);
|
||||
|
||||
final event = Events.fromJson(jsonDecode(responseBody));
|
||||
events = Events.fromJson(jsonDecode(responseBody));
|
||||
final locale = Provider.of<LocaleProvider>(context, listen: false)
|
||||
.locale
|
||||
?.toString() ??
|
||||
'en_US';
|
||||
final startDate =
|
||||
DateTime.parse(event.startDate ?? DateTime.now().toString());
|
||||
DateTime.parse(events?.startDate ?? DateTime.now().toString());
|
||||
//final date = DateFormat.yMd().format(startDate);
|
||||
//final time = DateFormat.Hm().format(startDate);
|
||||
final endDate =
|
||||
DateTime.parse(event.endDate ?? DateTime.now().toString());
|
||||
DateTime.parse(events?.endDate ?? DateTime.now().toString());
|
||||
String separator = AppLocalizations.of(context)?.at ?? "at";
|
||||
final formattedStartDate =
|
||||
DateFormat("EEEE d MMMM y '${separator}' HH:mm", locale)
|
||||
@@ -151,14 +151,14 @@ class _ItemMenuState extends State<ItemMenu> with ShowAlertDialog {
|
||||
String link = AppLocalizations.of(context)?.to_date ?? "to";
|
||||
|
||||
setState(() {
|
||||
eventName = event.name ?? "";
|
||||
eventName = events?.name ?? "";
|
||||
|
||||
eventStartDate = "$formattedStartDate ${link} $formattedEndDate";
|
||||
organizers = List<String>.from(event.organizers ?? []);
|
||||
place = event.place ?? "";
|
||||
imgUrl = event.imgUrl ?? "";
|
||||
eventDescription = event.description ?? "";
|
||||
tags = List<String>.from(event.tags ?? []);
|
||||
organizers = List<String>.from(events?.organizers ?? []);
|
||||
place = events?.place ?? "";
|
||||
imgUrl = events?.imgUrl ?? "";
|
||||
eventDescription = events?.description ?? "";
|
||||
tags = List<String>.from(events?.tags ?? []);
|
||||
});
|
||||
} else {
|
||||
final messages = {
|
||||
|
Reference in New Issue
Block a user