ValidationParser<I, O> class

It allows you to convert a field from an x type to a y type.

Inheritance

Constructors

ValidationParser(O converter(I value), {String? errorCode, List<Validator<O>> validators = const []})
const

Properties

converter → O Function(I value)
final
errorCode String?
Use a custom error string to differentiate between errors
finalinherited
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
validators List<Validator<O>>
final

Methods

call(I value) Object?
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override

Operators

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

Static Methods

doubleToInt({String? errorCode = InvalidValidationError.rationalCode, List<Validator<int>> validators = const []}) ValidationParser<double, int>
stringToDouble({String? errorCode = InvalidValidationError.doubleCode, List<Validator<double>> validators = const []}) ValidationParser<String, double>
stringToInt({String? errorCode = InvalidValidationError.intCode, List<Validator<int>> validators = const []}) ValidationParser<String, int>
stringToRational({String? errorCode = InvalidValidationError.rationalCode, List<Validator<Rational>> validators = const []}) ValidationParser<String, Rational>