validate method

bool validate()

Implementation

bool validate() {
  var root = models[0];

  try {
    environment.get<WidgetValidator>().validate(root,
        type: clazz!,
        environment: environment
    );

    return true;
  }
  on ValidationException catch (e) {
    environment.get<MessageBus>().publish("messages", MessageEvent(
        source: this,
        type: MessageEventType.set,
        messages: e.errors.map((error) =>  Message(
            type: MessageType.error,
            widget: error.widget,
            property: error.property,
            message: message(error.exception)
        )).toList()
    ));

    return false;
  }
}