SmartApiEnvelope class
The parsed, normalized shape of a raw JSON response body, produced by
either SmartApiEnvelope.defaultParse or a custom
SmartApiConfig.responseParser.
Constructors
- SmartApiEnvelope({required bool success, String message = "", int? statusCode, dynamic data})
-
Creates an envelope directly. Most callers get one back from
SmartApiEnvelope.defaultParse rather than constructing it by hand.
const
- SmartApiEnvelope.defaultParse(dynamic json)
-
The default response parser, used when no custom
SmartApiConfig.responseParseris set. Reads keys according to SmartApiConfigKeyMapHolder.keyMap (set viaSmartApiConfig.init(keyMap: ...)).factory
Properties
- data → dynamic
-
The raw, un-typed payload extracted from the response body.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- message → String
-
A human-readable message extracted from the response, if any.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- statusCode → int?
-
A status code embedded in the response body, if any (distinct from
the HTTP status code).
final
- success → bool
-
Whether the backend considered this request successful.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited