MessageResolver class
Turns issue codes into messages.
Order of lookup:
- the message set on the rule (
.min(3, message: '...')) messages['path.code'], likeemail.requiredoritems.*.name.requiredmessages['code'], likerequired- the default English template
For i18n, extend this class and override resolve, then set
MessageResolver.global or pass it to safeParse(messages: ...).
Constructors
-
MessageResolver({Map<
String, String> messages = const <String, String>{}})
Properties
Methods
-
format(
String template, Map< String, Object?> params) → String -
Fill placeholders in
template. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
resolve(
MessageRequest request) → String - Build the final message.
-
setMessages(
Map< String, String> messages) → void - Add or replace templates.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- global ↔ MessageResolver
-
The resolver used when none is passed to
parse.getter/setter pair