validate method

void validate({
  1. required Map<String, dynamic> rules,
  2. Map<String, dynamic>? data,
  3. Map<String, dynamic>? messages,
  4. bool showAlert = true,
  5. Duration? alertDuration,
  6. ToastNotificationStyleType alertStyle = ToastNotificationStyleType.WARNING,
  7. required dynamic onSuccess()?,
  8. dynamic onFailure(
    1. Exception exception
    )?,
  9. String? lockRelease,
})

Validate data from your widget.

Implementation

void validate(
    {required Map<String, dynamic> rules,
    Map<String, dynamic>? data,
    Map<String, dynamic>? messages,
    bool showAlert = true,
    Duration? alertDuration,
    ToastNotificationStyleType alertStyle =
        ToastNotificationStyleType.WARNING,
    required Function()? onSuccess,
    Function(Exception exception)? onFailure,
    String? lockRelease}) {
  updatePageState("validate", {
    "rules": rules,
    "data": data,
    "messages": messages,
    "showAlert": showAlert,
    "alertDuration": alertDuration,
    "alertStyle": alertStyle,
    "onSuccess": onSuccess,
    "onFailure": onFailure,
    "lockRelease": lockRelease,
  });
}