actionOnEvent method
Future<bool>
actionOnEvent(
- EventNotificationModel event,
- ATKEY_TYPE_ENUM keyType, {
- required bool isAccepted,
- required bool isSharing,
- required bool isExited,
- bool? isCancelled,
Processes any kind of update in an event and notifies creator/members
Implementation
Future<bool> actionOnEvent(
EventNotificationModel event, ATKEY_TYPE_ENUM keyType,
{required bool isAccepted,
required bool isSharing,
required bool isExited,
bool? isCancelled}) async {
var eventData = EventNotificationModel.fromJson(jsonDecode(
EventNotificationModel.convertEventNotificationToJson(event)));
try {
if (isCancelled == true) {
await updateEventMemberInfo(eventData,
isAccepted: false, isExited: true, isSharing: false);
} else {
await updateEventMemberInfo(eventData,
isAccepted: isAccepted, isExited: isExited, isSharing: isSharing);
}
notifyListeners();
return true;
} catch (e) {
_logger.severe('error in updating event $e');
return false;
}
}