CommandResult class
The result of running a Command.
Constructors
-
CommandResult(List<
ValidationError> errors) -
Creates a CommandResult with
errors
;const -
CommandResult.failed(List<
ValidationError> errors) - Creates a failed CommandResult and ensures it has errors.
-
CommandResult.fromJson(Map<
String, dynamic> json) - Creates a CommandResult from JSON.
- CommandResult.success()
-
Creates a success CommandResult without any errors.
const
Properties
-
errors
→ List<
ValidationError> -
Validation errors related to the data carried by the Command.
final
- failed → bool
-
Whether the command has failed with errors.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- success → bool
-
Whether the command has succeeded.
no setter
Methods
-
hasError(
int code) → bool -
Checks whether this CommandResult contains a provided error
code
in its validation errors. -
hasErrorForProperty(
int code, String propertyName) → bool -
Checks whether this CommandResult contains a provided error
code
in its validation errors related to thepropertyName
. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> - Serializes this CommandResult to JSON.
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited