ResultShape class
The wire shape of what an action returns.
Extracted from the PluginResult class an action declares in returns:,
never written by hand. A schema maintained alongside the code disagrees with
it by the third field; a schema read from the code cannot.
It carries what a sample of real output never could: which fields are optional. "This package has no error" and "this package cannot have one" look identical in a response and are different promises.
Constructors
-
ResultShape(String type, List<
ResultField> fields, {bool gates = false}) -
const
Properties
-
fields
→ List<
ResultField> -
final
- gates → bool
-
Whether this result decides the exit code — true for a class implementing
ReportsFailure, whoseokfield is whatfwexits 1 on.final - hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- type → String
-
The class name, which is also what
PluginAction.returnsNamereports.final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, Object?> -
toString(
) → String -
A string representation of this object.
inherited
-
toText(
{String indent = '', bool docs = true}) → String - The shape as an indented tree.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
fromJson(
Map< String, Object?> json) → ResultShape