DecimalRule class final

decimal:2 and decimal:0,4.

Laravel 13's validateDecimal reads the places with the possessive /^[+-]?\d*+\.?+(\d*+)$/, which PCRE never backtracks into. Dart's RegExp has no possessive quantifiers, and the plain \d*\.?(\d*) the port first used took time quadratic in the length of the value (from 1.22.0 until this was fixed). The pattern here has one way to match each string, so it is linear, and it matches the same strings with the same capture.

Inheritance
Available extensions

Constructors

DecimalRule(int min, [int? max])
min to max digits after the decimal point.
const

Properties

hashCode → int
The hash code for this object.
no setterinherited
implicit → bool
Implicit rules run even when the attribute is absent or empty (required*, present, prohibited*).
no setterinherited
max → int?
The most digits after the point; exactly min when null.
final
min → int
The fewest digits after the point.
final
name → String
Rule identifier used in messages and the string DSL (required).
no setteroverride
parameters → Map<String, Object?>
Placeholder values for messages (:min, :other, :values).
no setteroverride
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
schemaHint → Map<String, Object?>
Hint for OpenAPI generation ({'type': 'string', 'maxLength': 32}).
no setterinherited

Methods

accepted() → RuleBuilder

Available on Rule, provided by the RuleChain extension

This rule followed by Rules.accepted.
acceptedIf(String other, List<String> values) → RuleBuilder

Available on Rule, provided by the RuleChain extension

This rule followed by Rules.acceptedIf.
after(String dateOrField) → RuleBuilder

Available on Rule, provided by the RuleChain extension

This rule followed by Rules.after.
afterOrEqual(String dateOrField) → RuleBuilder

Available on Rule, provided by the RuleChain extension

This rule followed by Rules.afterOrEqual.
alpha() → RuleBuilder

Available on Rule, provided by the RuleChain extension

This rule followed by Rules.alpha.
alphaDash() → RuleBuilder

Available on Rule, provided by the RuleChain extension

This rule followed by Rules.alphaDash.
alphaNum() → RuleBuilder

Available on Rule, provided by the RuleChain extension

This rule followed by Rules.alphaNum.
ascii() → RuleBuilder

Available on Rule, provided by the RuleChain extension

This rule followed by Rules.ascii.
bail() → RuleBuilder

Available on Rule, provided by the RuleChain extension

This rule followed by Rules.bail.
before(String dateOrField) → RuleBuilder

Available on Rule, provided by the RuleChain extension

This rule followed by Rules.before.
beforeOrEqual(String dateOrField) → RuleBuilder

Available on Rule, provided by the RuleChain extension

This rule followed by Rules.beforeOrEqual.
between(num min, num max) → RuleBuilder

Available on Rule, provided by the RuleChain extension

This rule followed by Rules.between.
boolean() → RuleBuilder

Available on Rule, provided by the RuleChain extension

This rule followed by Rules.boolean.
confirmed([String? field]) → RuleBuilder

Available on Rule, provided by the RuleChain extension

This rule followed by Rules.confirmed.
custom(FutureOr<String?> check(ValidationContext context), {String name = 'custom'}) → RuleBuilder

Available on Rule, provided by the RuleChain extension

This rule followed by Rules.custom.
date() → RuleBuilder

Available on Rule, provided by the RuleChain extension

This rule followed by Rules.date.
declined() → RuleBuilder

Available on Rule, provided by the RuleChain extension

This rule followed by Rules.declined.
declinedIf(String other, List<String> values) → RuleBuilder

Available on Rule, provided by the RuleChain extension

This rule followed by Rules.declinedIf.
different(String other) → RuleBuilder

Available on Rule, provided by the RuleChain extension

This rule followed by Rules.different.
digits(int length) → RuleBuilder

Available on Rule, provided by the RuleChain extension

This rule followed by Rules.digits.
digitsBetween(int min, int max) → RuleBuilder

Available on Rule, provided by the RuleChain extension

This rule followed by Rules.digitsBetween.
distinct() → RuleBuilder

Available on Rule, provided by the RuleChain extension

This rule followed by Rules.distinct.
email() → RuleBuilder

Available on Rule, provided by the RuleChain extension

This rule followed by Rules.email.
endsWith(List<String> suffixes) → RuleBuilder

Available on Rule, provided by the RuleChain extension

This rule followed by Rules.endsWith.
enumValues<E extends Enum>(List<E> values) → RuleBuilder

Available on Rule, provided by the RuleChain extension

This rule followed by Rules.enumValues.
exists(String table, [String? column]) → RuleBuilder

Available on Rule, provided by the RuleChain extension

This rule followed by Rules.exists.
extensions(List<String> extensions) → RuleBuilder

Available on Rule, provided by the RuleChain extension

This rule followed by Rules.extensions.
file() → RuleBuilder

Available on Rule, provided by the RuleChain extension

This rule followed by Rules.file.
filled() → RuleBuilder

Available on Rule, provided by the RuleChain extension

This rule followed by Rules.filled.
image({bool allowSvg = false}) → RuleBuilder

Available on Rule, provided by the RuleChain extension

This rule followed by Rules.image.
inList(List<Object?> values) → RuleBuilder

Available on Rule, provided by the RuleChain extension

This rule followed by Rules.inList.
integer() → RuleBuilder

Available on Rule, provided by the RuleChain extension

This rule followed by Rules.integer.
ip() → RuleBuilder

Available on Rule, provided by the RuleChain extension

This rule followed by Rules.ip.
ipv4() → RuleBuilder

Available on Rule, provided by the RuleChain extension

This rule followed by Rules.ipv4.
ipv6() → RuleBuilder

Available on Rule, provided by the RuleChain extension

This rule followed by Rules.ipv6.
json() → RuleBuilder

Available on Rule, provided by the RuleChain extension

This rule followed by Rules.json.
list() → RuleBuilder

Available on Rule, provided by the RuleChain extension

This rule followed by Rules.list.
lowercase() → RuleBuilder

Available on Rule, provided by the RuleChain extension

This rule followed by Rules.lowercase.
map() → RuleBuilder

Available on Rule, provided by the RuleChain extension

This rule followed by Rules.map.
max(num value) → RuleBuilder

Available on Rule, provided by the RuleChain extension

This rule followed by Rules.max.
mimes(List<String> extensions) → RuleBuilder

Available on Rule, provided by the RuleChain extension

This rule followed by Rules.mimes.
mimetypes(List<String> types) → RuleBuilder

Available on Rule, provided by the RuleChain extension

This rule followed by Rules.mimetypes.
min(num value) → RuleBuilder

Available on Rule, provided by the RuleChain extension

This rule followed by Rules.min.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notIn(List<Object?> values) → RuleBuilder

Available on Rule, provided by the RuleChain extension

This rule followed by Rules.notIn.
notRegex(RegExp pattern) → RuleBuilder

Available on Rule, provided by the RuleChain extension

This rule followed by Rules.notRegex.
nullable() → RuleBuilder

Available on Rule, provided by the RuleChain extension

This rule followed by Rules.nullable.
numeric() → RuleBuilder

Available on Rule, provided by the RuleChain extension

This rule followed by Rules.numeric.
parametersFor(ValidationContext context) → Map<String, Object?>
parameters for a failure on context, for a placeholder that shows the input (accepted_if's :value).
inherited
passes(ValidationContext c) → String?
Checks the value in context: the message key or text when it fails, null when it passes.
override
password({int min = 8, bool letters = false, bool mixedCase = false, bool numbers = false, bool symbols = false}) → RuleBuilder

Available on Rule, provided by the RuleChain extension

This rule followed by Rules.password.
present() → RuleBuilder

Available on Rule, provided by the RuleChain extension

This rule followed by Rules.present.
prohibited() → RuleBuilder

Available on Rule, provided by the RuleChain extension

This rule followed by Rules.prohibited.
regex(RegExp pattern) → RuleBuilder

Available on Rule, provided by the RuleChain extension

This rule followed by Rules.regex.
required() → RuleBuilder

Available on Rule, provided by the RuleChain extension

This rule followed by Rules.required.
requiredIf(String other, Object? value) → RuleBuilder

Available on Rule, provided by the RuleChain extension

This rule followed by Rules.requiredIf.
requiredUnless(String other, Object? value) → RuleBuilder

Available on Rule, provided by the RuleChain extension

This rule followed by Rules.requiredUnless.
requiredWith(List<String> others) → RuleBuilder

Available on Rule, provided by the RuleChain extension

This rule followed by Rules.requiredWith.
requiredWithout(List<String> others) → RuleBuilder

Available on Rule, provided by the RuleChain extension

This rule followed by Rules.requiredWithout.
same(String other) → RuleBuilder

Available on Rule, provided by the RuleChain extension

This rule followed by Rules.same.
size(num value) → RuleBuilder

Available on Rule, provided by the RuleChain extension

This rule followed by Rules.size.
sometimes() → RuleBuilder

Available on Rule, provided by the RuleChain extension

This rule followed by Rules.sometimes.
startsWith(List<String> prefixes) → RuleBuilder

Available on Rule, provided by the RuleChain extension

This rule followed by Rules.startsWith.
string() → RuleBuilder

Available on Rule, provided by the RuleChain extension

This rule followed by Rules.string.
toString() → String
A string representation of this object.
inherited
ulid() → RuleBuilder

Available on Rule, provided by the RuleChain extension

This rule followed by Rules.ulid.
unique(String table, [String? column, Object? ignore, String idColumn = 'id']) → RuleBuilder

Available on Rule, provided by the RuleChain extension

This rule followed by Rules.unique.
uppercase() → RuleBuilder

Available on Rule, provided by the RuleChain extension

This rule followed by Rules.uppercase.
url() → RuleBuilder

Available on Rule, provided by the RuleChain extension

This rule followed by Rules.url.
uuid() → RuleBuilder

Available on Rule, provided by the RuleChain extension

This rule followed by Rules.uuid.

Operators

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