addNotifications<T> method

void addNotifications<T>(
  1. T r
)

Implementation

void addNotifications<T>(T r) {
  if (r is ValidationNotification) {
    _notifications.add(r);
  } else if (r is List<ValidationNotification>) {
    _notifications.addAll(r);
  } else if (r is Contract) {
    r.notifications.forEach((f) => _notifications.add(f));
  } else if (r is List) {
    if (r.length > 1) {
      _notifications
          .add(ValidationNotification(property: r[0], message: r[1]));
    }
  }
}