ContentIssue class final
A problem that keeps BarcodeContent.toPayload from building a value, from BarcodeContent.validate.
message is in English; to show the problem in another language, use field, kind and limit:
String say(ContentIssue issue) => switch (issue.kind) {
ContentIssueKind.empty => 'Обязательное поле',
ContentIssueKind.tooLong => 'Не больше ${issue.limit} символов',
_ => issue.message,
};
- Annotations
Constructors
- ContentIssue(String field, String message, {ContentIssueKind kind = ContentIssueKind.invalid, int? limit})
-
Creates an issue with
field.const
Properties
- field → String
-
The name of the field with the problem, as in the constructor:
ssid,latitude,emails.final - hashCode → int
-
The hash code for this object.
no setteroverride
- kind → ContentIssueKind
-
What kind of problem it is.
final
- limit → int?
-
For ContentIssueKind.tooLong, the most the field may hold: characters,
bytes or items, as message says; otherwise
null.final - message → String
-
What is wrong, in English:
Network name is empty.final - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
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.
override