fix edit event
This commit is contained in:
@@ -645,7 +645,8 @@ class _EditEventState extends State<EditEvent>
|
||||
),
|
||||
Padding(
|
||||
//padding: const EdgeInsets.only(left:15.0,right: 15.0,top:0,bottom: 0),
|
||||
padding: EdgeInsets.symmetric(horizontal: 15),
|
||||
padding: const EdgeInsets.only(
|
||||
left: 15.0, right: 15.0, top: 15, bottom: 0),
|
||||
child: TextFormField(
|
||||
controller: inputLink,
|
||||
validator: (value) => _validateField(value),
|
||||
@@ -658,7 +659,8 @@ class _EditEventState extends State<EditEvent>
|
||||
),
|
||||
Padding(
|
||||
//padding: const EdgeInsets.only(left:15.0,right: 15.0,top:0,bottom: 0),
|
||||
padding: EdgeInsets.symmetric(horizontal: 15),
|
||||
padding: const EdgeInsets.only(
|
||||
left: 15.0, right: 15.0, top: 15, bottom: 0),
|
||||
child: TextFormField(
|
||||
controller: inputTicket,
|
||||
validator: (value) => _validateField(value),
|
||||
|
@@ -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