ValidatorConfig class

Holds configuration settings for validation behavior.

This class allows you to configure how validation should behave globally. You can pass an instance of ValidatorConfig to control localization, caching, error styles, and rule processing strategy.

Example:

Checkit.config = ValidatorConfig(
  stopOnFirstError: true,
  usePermanentCache: true,
  caseHandling: CaseHandling.lowercase,
  errors: CustomCheckitErrors(),
);

Constructors

ValidatorConfig({bool stopOnFirstError = false, ICheckitErrors errors = const CheckitErrors(stringErrors: StringCheckitErrors(), generalErrors: GeneralCheckitErrors(), numErrors: NumCheckitErrors(), stringDateErrors: StringDateCheckitErrors(), passwordErrors: PasswordCheckitErrors(), ipErrors: IpCheckitErrors(), intErrors: IntCheckitErrors(), doubleErrors: DoubleCheckitErrors()), Warnings warnings = const Warnings(), CaseHandling caseHandling = CaseHandling.exact, bool usePermanentCache = false})

Properties

caseHandling CaseHandling
Controls case sensitivity behavior during string validation.
final
errors ICheckitErrors
The error message providers used by validators.
final
hashCode int
The hash code for this object.
no setterinherited
resources ValidationResourcesBase
Additional resources that can be used during validation.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stopOnFirstError bool
Whether validation should stop at the first error encountered.
final
usePermanentCache bool
If true, validators will reuse resources between validations.
final
warnings Warnings
The warning providers used for supplementary messages or notices.
final

Methods

buildContext() ValidationContext
Creates a ready-to-use context from this config.
copyWith({ValidationContext? context, bool? stopOnFirstError, bool? usePermanentCache, ICheckitErrors? errors, CaseHandling? caseHandling}) ValidatorConfig
Creates a modified copy of this config with optional changes.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited