validate static method

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

Validate data from your widget.

Implementation

static validate(String state,
    {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}) {
  _updateState(state, "validate", {
    "rules": rules,
    "data": data,
    "messages": messages,
    "showAlert": showAlert,
    "alertDuration": alertDuration,
    "alertStyle": alertStyle,
    "onSuccess": onSuccess,
    "onFailure": onFailure,
    "lockRelease": lockRelease,
  });
}