ResponseParser class
Shared response parsing logic used by both HTTP and Dio implementations.
This avoids duplicating the decode → unwrap → parse → build response pipeline in each caller.
Constructors
- ResponseParser(NetworkConfig _config)
-
const
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- 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
-
parse<
T> ({required int statusCode, required dynamic body, T parser(dynamic json)?, Map< String, String> ? responseHeaders, String? reasonPhrase}) → NetworkResponse<T> - Parses a raw HTTP response into a typed NetworkResponse.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
decodeJsonBody(
String rawBody) → dynamic - Decodes a raw JSON string into a dynamic value (Map or List).