SdkContract class

Describes how the SDK should interpret a backend response contract.

The SDK uses this contract to extract user-facing data, resolve messages, and determine whether a response should be treated as successful.

Constructors

SdkContract.new({required Set<int> successStatusCodes, required String dataPath, required String messagePath, required IsBodySuccess isBodySuccess})
Creates an explicit response contract definition.
const
SdkContract.auto({Set<int>? successStatusCodes, required String data, required String message, String? successFlag, String? errorCode})
Creates a common contract with optional success flag and error code checks.
factory

Properties

dataPath String
Dot-separated path used to extract the normalized response payload.
final
hashCode int
The hash code for this object.
no setterinherited
isBodySuccess IsBodySuccess
Additional body-level success evaluation applied to JSON map responses.
final
messagePath String
Dot-separated path used to extract a response message.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
successStatusCodes Set<int>
HTTP status codes that are considered transport-level success.
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