update method

Future<QBEvent?> update(
  1. int id, {
  2. bool? active,
  3. Map<String, Object>? payload,
  4. double? date,
  5. String? period,
  6. String? name,
})

Implementation

Future<QBEvent?> update(int id,
    {bool? active,
    Map<String, Object>? payload,
    double? date,
    String? period,
    String? name}) async {
  Map<String, Object> data = Map();

  data["id"] = id;

  if (active != null) {
    data["active"] = active;
  }
  if (payload != null) {
    data["payload"] = payload;
  }
  if (date != null) {
    data["date"] = date;
  }
  if (period != null) {
    data["period"] = period;
  }
  if (name != null) {
    data["name"] = name;
  }

  Map<Object?, Object?> map =
      await _notificationModule.invokeMethod(UPDATE_METHOD, data);

  QBEvent? qbEvent = QBEventMapper.mapToQBEvent(map);

  return qbEvent;
}